Jump to content
  • Advertisement


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


more MD2 questions

This topic is 5620 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

It seems as if I''m only able to load a single frame from the file. Are there triangle indices for each frame? I''m not sure how this works since there''s only an offset to the triangle list and then number of triangles. It seems to me that there is only 1 list of triangle indices. I found this code used to load them:

triangleIndices = &buffer[offsetTriangles];
 triangle[i].vertexIndices[0] = triangleIndices[i].vertexIndices[0];
What I don''t get is why loop through the frames? If this code is correct, then wouldn''t the triangle array get overwritten each time and only end up with the values in the last loop? Is there a list of triangle indices for each frame?

Share this post

Link to post
Share on other sites
Your code is a bit sketchy, but from what I remember of MD2 you should have:

[a number of frames, each of which contain ...]
[a number of vertices. Each frame has the same number of vertices]
[a number of indices which come in multiples of three (triangles)]

so you have SEVERAL frames, each of which has the same number of vertices - but usually in different positions.

You have ONE group of indices, which you can use for any frame since they index the same vertices in each frame.

Kinda make sense?

Share this post

Link to post
Share on other sites

  • 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!