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
MD2 Loader
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.
Don't be so lazy. What errors do you get with the code?
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?
The definitive MD2 loading code can be found here: ftp://ftp.idsoftware.com/idstuff/source/q2source-3.21.zip
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.
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!
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.
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.
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement