Archived

This topic is now archived and is closed to further replies.

pjupju

Md2 fileformat?

Recommended Posts

First I would like to say Hello World! Just registered with this forum and have checked out the faqs and some previous posts. I recently decided that I was going to learn how to import a 3d model and draw it using opengl. I checked google for opengl model loading and found that the md2 fileformat was supposed to be good for learning. I managed to find lots of sourcecode which is nice if I just want it to work, but I want to understand it too(nasty habit of mine). And those sourcecode examples didn''t explain the file format so I went searching. I used google, wotsit and id softwares homepage and managed to find one or two sites that explained the header and showed some structs for vertices and triangles.. However I didn''t understand what to do with the data I read in, nor how to read it in. If I understood correctly there''s an array of vertices and an array of triangles. So that must mean the triangle tells me the index of the vertices it uses to draw right? But how do I load that information in? I checked source code examples but the use int for the header while they at the same time claim each part of the header to be 4bytes and alot of other stuff that''s confusing to me. So even if I do manage to understand their code and do my own implementation of it, how did they find the info. How do they know the vertices are stored in the file as floating point values or whatnot. I searched google, wotsit and checked id softwares site for a file format description but was unable to find it complete anywhere. Does anyone know where I can find it or how they found out? Sorry if I ranted on for to long and kept repeating myself, but I wanted to give as much information as possible regarding my problem so it hopefully would be easier to help me.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Check out www.gametutorials.com - they have a tutorial on there for loading/displaying MD2 models with OpenGL

Share this post


Link to post
Share on other sites