Jump to content
  • Advertisement
Sign in to follow this  
crunch

How to show an object from maya in opengl?

This topic is 4060 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!