Jump to content
  • Advertisement
Sign in to follow this  
VitaliBR

MD2 Loader

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

Hi!

I tried using the following code to load an md2 model, but the collection of several errors.
http://www.flipcode.com/archives/MD2_Model_Loader.shtml

I wonder where I can find a code ready to load md2.

Thanks

Share this post


Link to post
Share on other sites
Advertisement
This doesn't exactly answer your question but... Md2 is a very old format. You would be better off choosing a more modern animation format. Md3 or Md5 would be a better start as you will more likely find tools that work with modern 3d applications.

Quote:
I wonder where I can find a code ready to load md2.


Don't be so lazy. What errors do you get with the code?

Share this post


Link to post
Share on other sites
The definitive MD2 loading code can be found here: ftp://ftp.idsoftware.com/idstuff/source/q2source-3.21.zip

Share this post


Link to post
Share on other sites
Assimp reads MD2 as well (amongst many other formats), but it does not currently support vertex animations. If you don't need those, it might be useful for you.

Share this post


Link to post
Share on other sites
Quote:
Original post by mhagain
The definitive MD2 loading code can be found here: ftp://ftp.idsoftware.com/idstuff/source/q2source-3.21.zip


Theoretically yes.

In modern terms, not really. The quake 2 source is from 1998 and is game code. There are lots of nasty hacks in the source, very very nasty hacks in modern terms. I wouldn't expect to see C++ code like this in any project this decade!

Share this post


Link to post
Share on other sites
http://tfc.duke.free.fr/coding/md5-specs-en.html

Although I'd recommend building your own format around what you need.

For instance Md5 is a good format for CPU based animation, but the amount of data require means it is terra-bad on the gpu.

Share this post


Link to post
Share on other sites
I've got some MD2 loading code if you want it, wrapped up in a C++ class. One caveat though: it only loads 1 animation frame in the mesh (the 1st) since that all I needed for the game were static models.

It's not a huge job however to extend it to load the other frames- just add a for loop and read one frame at a time.

Download the source code for 'Rogue Trader' and check out the 'MD2Mesh' class and 'MD2Mesh.h':

http://www.darraghcoy.com

Let me know if you have any questions about it.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!