PDA

View Full Version : OpenGL - Maya model into OpenGL!?


C4stoR
07-10-2005, 07:21 PM
i am an opengl noob and not a good programer. 2-3 years ago when i programed in c++ ;)

so i just want to know how to get a maya model into an opengl app

mummey
07-10-2005, 10:59 PM
heh, there is no one-button way which I have the feeling you were hoping for. Sorry. :shrug:

Look into the OBJ file format. Maya exports it. It is not hard to write code that will then read it into OpenGL.

C4stoR
07-11-2005, 04:44 AM
well i already thought it would be something like that :)

mbaas
07-11-2005, 07:13 PM
If you aren't using any scene graph library that already has functionality to import 3D models, you have to import the models yourself.

There are some libraries you could use to import polygonal models:

- lib3ds for 3DS files: http://lib3ds.sourceforge.net/
- CyberX3D for VRML or X3D files: http://www.cybergarage.org/vrml/cx3d/cx3dcc/index.html
- RPly for PLY files: http://www.cs.princeton.edu/~diego/professional/rply/

From this list, Maya can only export VRML. If you want to use the other formats, this is a good opportunity for me to do some shameless advertising for a package I have written, the Python Computer Graphics Kit (or cgkit for short): http://cgkit.sourceforge.net/
You could use this package to convert the Maya model into any convenient format. The package can even import Maya ASCII files (with some restrictions, of course). Once loaded, you can easily access verts, faces, etc. from a Python script and do whatever you want with it. For example, you could convert the model into C++ source code to embed it right into your application (which has the advantage that no explicit importer is required anymore).

- Matthias -

C4stoR
07-11-2005, 08:04 PM
thx for reply

i will read this stuff :D

CGTalk Moderation
07-11-2005, 08:04 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.