Jump to content
  • Advertisement


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


rendering md2 files as triangle strips

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

MD2''s are rendered as a collection of triangle strips and fans.

By working through the data held in the "GL_COMMANDLIST", you''ll construct a series of triangle strips/fans to render.

The X,Y,Z of each vertex is "compressed" down to one byte each, and each frame has unique scale and translate values that have to be applied to each vertex to turn them into their actual values.

The CommandList is just a series of float and integer value groups. For each group the first value denotes whether you should be constructing a triangle strip or a fan and how many vertices it contains. (-7) means make a triangle fan from the next seven commands, (+7) means make a triangle strip from the next seven commands. The next seven commands would then comprise of the actual tu,tv texture coordinate (floats) and the VertexIndex. If you''ve already transformed the vertices for the current frame, TransformedVertices[VertexIndex] would provide the correct X,Y,Z.

I found this document pretty useful. (In fact I was able to write all my MD2 code from it).

If you are using DirectX you''re welcome to my md2 classes if you want them.



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!