How to interface with Autodesk Maya 2014 built in renderer? - c++

I am building a autodesk maya 2014 ray tracing plugin with the maya c++ API. my plugin runs in maya but the output image is directly written to the hardisk, it's very clumsy.
I am trying to find a way to interface with maya built in renderer and thus seeing the output image in maya view port and getting the option to save the image within the maya interface.
I want the option to render my scene within maya using my ray tracing algorithm and watch the output image in maya (not writing the image externally to the disk).
There is almost no tutorials for writing maya plugins and how to use the maya API I could find by googling.
I will try to focus my question and add some more question regarding the implementation itself:
can you direct me to a tutorial for how to code an extension (like mental ray) in c++ using the maya API that will work within maya and will render and show the output of my custom ray tracing algorithm in maya view port?
and for the implementation itself: i am a little confused with all the coordinate systems used by maya and openGL. lets assume i found a perspective camera and its dag path using an iterator in the plugin itself, and i have all the scene objects vertices (again iterator within the plugin). how do i convert those vertices from model\camera\object spaces to screen space?
the same question as the second question but now instead of getting the vertices in screen space as before i want a way to print them in a maya view port?

Related

How do I render all actors in a single area using DirectX 11 in C++ efficiently and easily?

I have searched SO and have not found one relating to the very basics, explaining step by step. We are in need of this.
Assuming that I am using only the DirectX SDK supplied by microsoft.
Also assuming that I have .fbx and .3ds models already made and in the working directory which are generic, monochrome, shapes (cube, sphere, pyramid, etc.).
Please also condense the rendering process into a function that uses the directX functions (As in, can be compiled), as an example:
//the following is a suggestion, not a guideline for those who
//want to get into 3D programming.
vector<DX3DModel>modelsToBeRendered;
void bufferFrame(vector<DX3DModel>models){
while(1){
/* something something vertexes, lets say DX3DModel only contains vertexes
and a string as a file link
(Rendering code would make it very
messy in the question, but please include it in the answer.) */
//render models.end(); here
models.pop_back();
}
}
Using a method similar to what I have above, how would I (safely) render all other actors in a single "area" while still being able to manipulate vertexes at will?
(Area is a (AxBx1) model which we will call field.fbx. This is a boundary for all actors to exist on)
The Direct3D 11 API, much like the OpenGL API, is a low-level rendering API that works in terms of resources and drawing operations on constructs containing points, lines, and triangles. It's not a high-level API that can directly load or render an model file from a 3D editor, nor does it inherently have a material/effects system.
If you are new to DirectX 11, you should consider using the DirectX Tool Kit as a good starting-point. You can't directly render from a 3DS or FBX model, but you can use either the built-in Visual Studio content pipeline for converting to a CMO or use the Samples Content Exporter to convert to SDKMESH, both of which can be loaded by DirectX Tool Kit.
Using the DirectX Tool Kit, you'd be able to use the Model class and get something basically like what you propose. See the DirectX Tool Kit tutorial, particularly the lesson Rendering a model.
For Direct3D 11 development, you should strongly consider not using the legacy DirectX SDK as it's deprecated. If you are using VS 2012 or later, you don't need it. See Where is the DirectX SDK (2015 Edition)? and The Zombie DirectX SDK.

Exporting custom mesh from Maya in Vray

In a Maya plugin written in C++, I need to be able to render some custom-meshes using Vray. Vray comes with a library called GeomStaticMesh to easily pass and render these meshes.
While I could successfully render them (code a bit too long to paste here), they are not displayed in the exported .vrscene file, preventing distributed rendering. Would someone have a basic example of a maya/Vray plugin that allows rendering some meshes ?

Autodesk Maya, C++ and OpenGL rendering engine

What graphics engine Maya uses, OpenGL or DirectX? Does it at all use any? Since maya is written in C++.
For going deep into Maya, is it proper to learn to use OpenGL or one should go with DirectX?
My questions specially are associated with adding super new functionalities, such as new edge-system for a certain geometry in Maya.
What graphics engine Maya uses
Its own.
Neither OpenGL nor Direct3D are graphics engines. They're drawing APIs. You push in bunches of data and parameters and shaders to make sense of that data, and rasterized points, lines and triangles on a 2D framebuffer come out on the other side. That's it.
Maya, like every other graphics program out there implements its own engine or uses a graphics engine library that maybe uses Direct3D or OpenGL as a backend. In the case of Maya OpenGL is used for the interactive display. But the offline renderer is independent from that.
For going deep into Maya, is it proper to learn to use OpenGL or one should go with DirectX?
As long as you don't want to write lower-level-ish Maya plug-ins, you don't have to learn either.
My questions specially are associayted with adding super new functionalities, such as new edge-system for a certain geometry in Maya.
You surely want to make that available to the offline renderer as well. As such neiter OpenGL nor Direct3D are of use for you. You have to implement this using the graphics pipeline functions offered by Maya and its renderer. Note that you might also have to patch into external renderers if you want to use those with your news edge features.

Using Illustrator image for custom animation using C++

I have a vectorized Adobe Illustrator image that I would like to animate using custom xyz input (in this case simulated plot points that I would like to visualize over time, using a hand drawn picture/wireframe model) from e.g. a c++ program or perhaps even javascript application. Is there any (fairly straightforward) strategy to achieve this? E.g. using open GL or some other (open source) tool?
If you want to draw vectorized images you would need to use vector image renderer. The easiest way to do this is to use Flash since it has support vector drawing (one of the best) and really strong scripting language to do all sorts of things (anymate stuff based on input, etc) even 3d graphics.
The hard way of doing this is to use a custom library in c++ do draw vector grapics in opengl or directx. I can only speak of gameswf (opensource player for flash files) or scaleform. There two have support for swf files exported by flash. If you only need a renderer without any animation then there should be plenty of libraries out there (check out this thread)

C++ Library for 3D Monitor Display

I have 3D point cloud data and I would like to display the output on a 3D monitor. Is there a c++ library that can do this? I would also like the user to be able to pan, rotate, and zoom the point cloud. I am using a nvidia GeForce GT 540M 1GB vram video card.
There is the Point Cloud Library which uses the Visualization Toolkit to render. They support all basic forms of interaction, and I have used them to render point clouds. I think they would both be good starting points, and they use OpenGL to render. I know VTK has support for 3D displays, but have not used it in that way as I do not have access to a 3D monitor.