Sign in to follow this  
codemastermm

MD5 Model Loader?

Recommended Posts

codemastermm    148
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

Share this post


Link to post
Share on other sites
codemastermm    148
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.

Share this post


Link to post
Share on other sites
iNsAn1tY    476
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...

Share this post


Link to post
Share on other sites
skynet_    139
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.

Share this post


Link to post
Share on other sites
Kwizatz    1392
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.

Share this post


Link to post
Share on other sites
Kwizatz    1392
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this