MD5 Model Loader?

Started by
8 comments, last by Kwizatz 18 years, 5 months ago
I am curious if anyone has a decent MD5 Model loader that supports .md5mesh and .md5adnim and textures. (all of the other model loaders with source that I have found contain crap loads of other things that are not necessary for a basic model loader and are highly integrated with the unncessary things, making them nearly impossible to separate) I have been looking around and it seems flipcode, at one point, had source code for a great loader but alas they have closed their doors making the source code unreachable. Thank you for any help supplied :D
"Everything begins with Nu and everything ends with Nu. This is the truth! This is my belief... at least for now." - Mysteries of Life Volume 184 Chapter 26
Advertisement
My lib is pretty much just a md5mesh and md5anim parser, dont know if thats less than what you're looking for though.
Seems to be a good library and such, but with the external files (.y, .l, etc.) and the very odd defines (ie - the meshparse() function) I can barely dig through the code.
Also, I attempted to use Dev-C++ to compile the library and it doesn't seem to compile too well.
"Everything begins with Nu and everything ends with Nu. This is the truth! This is my belief... at least for now." - Mysteries of Life Volume 184 Chapter 26
I was working on an md5 loader up to a couple of weeks ago (university work has taken it's place for the time being). It parses md5mesh and md5anim files, and loads them into basic data structures. I then load that into my generic skeletal animation data structures. I've got as far as animating the skeleton. I was working on interpolating the weights when I had to stop.

I was planning to release the code when I'd finished it (I reckon another couple of weeks would do it), but if you want, I can post what I have now. It's pretty easy to follow, but it's pretty poorly laid out (everything's in one file, I've just grabbed source code from my other projects as and when I've needed it) and it hasn't been organized into coherent classes yet. Still, it does work...
My opinion is a recombination and regurgitation of the opinions of those around me. I bring nothing new to the table, and as such, can be safely ignored.[ Useful things - Firefox | GLee | Boost | DevIL ]
Could work - I might be able to throw it into various structs and classes for you, evene, perhaps.
"Everything begins with Nu and everything ends with Nu. This is the truth! This is my belief... at least for now." - Mysteries of Life Volume 184 Chapter 26
If you want first-hand information on the MD5 model format, download the Doom3 SDK. Its all there: loading/parsing/animating/blending Models and Animtions.
Quote:Original post by codemastermm
Seems to be a good library and such, but with the external files (.y, .l, etc.) and the very odd defines (ie - the meshparse() function) I can barely dig through the code.
Also, I attempted to use Dev-C++ to compile the library and it doesn't seem to compile too well.


The .l and .y files are for lex and yacc, you don't really need to compile them unless changes to the md5 syntax are introduced, they are used to generate the lex_md5mesh.c, yacc_md5mesh.c, yacc_md5mesh.h etc, those are the files you do need to compile, and dont bother reading them, they are a mess since they are automatically generated, but they get the work done.

I recomend looking at the sample directory for samples on how to use the lib once compiled.

Anyway, I noticed some of the aforementioned generated files are missing, I'll add them and update the VC project.
I was trying to see if I can reorganize your library (basically, tear it apart) and place it in part of mine - I guess I can try compiling it as-is and using it as you have.
"Everything begins with Nu and everything ends with Nu. This is the truth! This is my belief... at least for now." - Mysteries of Life Volume 184 Chapter 26
Quote:Original post by codemastermm
I was trying to see if I can reorganize your library (basically, tear it apart) and place it in part of mine - I guess I can try compiling it as-is and using it as you have.


Oh, one thing, if you're trying to create a project to build the library as a DLL, you have to define both DLL_EXPORT and BUILD_MD5LIB, on dev-c++ just add -DDLL_EXPORT -DBUILD_MD5LIB to your CPP flags, or you could just add -shared to your linker flags, in the later case ALL functions would get exposed on the DLL though, not really an issue.

Anyway, if you need any help, let me know.
Ok, I just added a Dev-C++ project to the source, its kind of tricky, you have to make sure the .c files are not compiled as c++ code.

Anyway, the project should get you started.

This topic is closed to new replies.

Advertisement