Sign in to follow this  
crunch

How to show an object from maya in opengl?

Recommended Posts

hi there! I just wondered if I could ask you a question which is haunting me: I have made an object in Maya and converted it to .cpp-format, and have included this converted file in my project like this: #included "catWalk.cpp". my problem is how to show this object in my own 3d world. How can "put" it into my scene? is this very complicated to do, or is it possible you can show me approximately how I can do this?(I am relatively new to C++) what am going to use it for? I and a group of friend are planning to make our own 3d-scene, and therefore we needed a way to include maya-objects in our scene. note: I used Deep Exloration for the exportation process. thanks so very much! ;)

Share this post


Link to post
Share on other sites
0) Do not #include .cpp files. You will generate linker errors because most development environments will automatically attempt to compile all files ending with .cpp.

1) There's no "standard" format for models "exported" to C++ code; in order to render that model, you'll have to make the appropriate OpenGL calls that the generated C++ code was designed to use. You'd probably have to read the exporter's documentation, but it might have comments. I suspect the C++ file contains mostly a large buffer of vertices you could render with glVertex3f, to get started (although that will get prohibitively slow eventually).

Overall "exporting" a model to C++ code is not really the best way to go about loading models.

Share this post


Link to post
Share on other sites
A common way of doing this is to create a maya file class. This class loads a maya file and extracts all the necessary information needed to display it such as vertex coordinates, keyframe data, texture coordinates, etc, and stores it in a format that can be used by other class methods to display an object. This requires you to know something of the maya file format. I'm sure you can find some documentation on it somewhere.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this