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,
Luke
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.
cu
Tom
OK, thanks for the info.
Luke
Hi,
You can also export to VRML or GE2 formats, both support animation and the plugins ship with maya as far as I know.
-Ilkka
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
Great link, thanks alYaro.
Luke
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
Yeah, but how do I make my own .obj loader
If I knew, I wouldn’t be asking how on here
Pssst… use google and type ‘obj loader source code’
2BigShooter:
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!
f
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…
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.
Ok, sounds good. Thanks for all the help everyone.