View Full Version : Any tutorials on loading Maya characters (with animation) into OpenGl?

08-01-2003, 11:16 AM
I've just finished reading Programming Guide to OpenGl. I've been doing computer graphics for the past 10 years. To OpenGl, I'm a beginner, but I do have about 4 years experience in programming C++. For me, the ultimate use of OpenGL would be to load a character from Maya (Maya ASCII format) possibly with all the skinning data and the texturing data and animations, and have that textured character walk on screen :-)
I have absolutely no clue how to do it, but I would really appreciate it if someone could point me to a tutorial for doing that, if such one exists.
Thank you,

08-01-2003, 04:50 PM
It#s really hard to open an Maya ASCII File. I don't know any good resources for this format.
There are 2 ways of doing what you want to do.
1st : Use the OBJ-Format. It's very simple, but you will be stuck to the mesh without animation.
2nd : Write your own exporter for Maya. It requires knowledge of Maya itself and how it manages the scene. But here you can export everything out of Maya you want.
There should be some examples for exporters right in the SDK.


08-01-2003, 04:53 PM
OK, thanks for the info.

08-02-2003, 12:59 AM

You can also export to VRML or GE2 formats, both support animation and the plugins ship with maya as far as I know.


08-02-2003, 08:58 AM
In that case, I'm looking for a tutorial on how to load .obj files (hierarchical geometry of a character stored in them) with animations into a format that OpenGl will understand :-)

08-02-2003, 01:51 PM
Look at www.gametutorials.com (http://www.gametutorials.com)
and try to search google.

08-02-2003, 02:18 PM
Great link, thanks alYaro.

08-04-2003, 03:40 AM
it's better make your own obj loader!
p.s. gametutorial's loader works bad! (that which i've downloaded 1year ago) it doesn't work with faces, which has more than 4 vertices(polygones). check their example - there's a foot.obj, and look it from their loader in wireframe mode! you'll see some strange polygons connecting between fingers http://www.opengl.org/discussion_boards/ubb/wink.gif

08-04-2003, 08:03 AM
Yeah, but how do I make my own .obj loader :-)
If I knew, I wouldn't be asking how on here :-)

08-04-2003, 02:44 PM
Pssst... use google and type 'obj loader source code'

08-04-2003, 10:30 PM
It's easy!
The OBJ File consists of vertices, normals, texture coordinates, faces. You just read it per-line.
vertex: v x y z (where x,y,z are float numbers)
normal: vn x y z
texcoord: vt x y
faces: (this wasn't done right in gametutorial's tutorial i think)
f v (indice of vertex for this face)
f v v ... (could be looong, so if there is 3"v", then it's triangle, 4 - quad, >4 -polygon)
f v/t (vertex,texcoord)
f v/t ...
f v/t/n
f v/t/n ... (vert,tex,normal indices)
that's all!
the hardest thing is to make the parsing of face lines, because it could be long, and you will need carefully read it!

08-05-2003, 02:48 AM

08-05-2003, 08:34 AM
Thank you guys for the info.
The main problem I have, where I totally get lost, is whn you are to read an animated character that has a hierarchy... :-(

08-05-2003, 09:09 AM
Ive heard that there are some plugins already written for maya to export models out in md3(Quake III model) md2(Quake II model) and mdl(Half-Life model). I would suggest getting one that exports in md3 since it has the most features out of all those models. There are plenty of docs on md3's. Look at www.gametutorials.com. (http://www.gametutorials.com.)

08-05-2003, 09:15 AM
Ok, sounds good. Thanks for all the help everyone.