Page 1 of 2
MD3 Mesh Format Loader
Posted: Wed Dec 10, 2003 10:28 pm
by madinitaly
Strangely enough, it works
And with animation, too!
http://aitolikon.sourceforge.net/Shot-10-12-2003-01.jpg
I think the "missing" triangles in the feet are due to bad vertex indices, anyway I tried loading different models with multiple surfaces and they work perfectly.
Now I just have to add automatic loading for skins and to understand how exactly does "animation.cfg" work.
After that, I'll try to make a class to load an entire model from a pk3 archive (Q3 models are tipically split in three parts) and then add specific MD3 features such as tags...
Uh, of course as soon as I think it's "mature", I'll post the code or even send it to Niko if he wishes to consider adding it as a feature for new versions.
Posted: Thu Dec 11, 2003 3:16 am
by sirshane
Sounds great. Thanks for the contribution, this is definately something I know I would find useful.
"Release"
Posted: Thu Dec 11, 2003 5:52 pm
by madinitaly
For who can't wait or who wants to test it, here is my first effort to extend Irrlicht by adding md3 models support.
CMD3MeshFileLoader-111203.zip
(Instructions inside the archive).
Posted: Thu Dec 11, 2003 7:55 pm
by stampsm
sweet, i am going to have to look through this to see how you did it
hopefully this will help me better understand how the models are loaded
Posted: Thu Dec 11, 2003 9:14 pm
by Spartacus
Nice now we can use a more "up to date" file format to load objects.
Posted: Fri Dec 12, 2003 7:14 pm
by yo
Congratulation Madinitaly
pit
New release
Posted: Fri Dec 12, 2003 11:07 pm
by madinitaly
Now with tags loading/handling and uses precalculated bounding boxes.
CMD3MeshFileLoader-121203.zip
As I said, I'm trying to implement a customizable class for loading a complete model from a pk3 file. It's going well, but I'm not familiar with tags, thus seems that I can't properly align meshes. If someone can help, here is my code (and dev-c++ project for a quick look at it):
CMD3Model.zip
Glad to give my modest contribute, happy coding
0.4.2
Posted: Sat Dec 13, 2003 6:19 pm
by madinitaly
Posted: Sat Dec 13, 2003 6:32 pm
by niko
Very cool, and useful. Wow, the 0.4.2 was fast! Impressive!
We're almost there!!!
Posted: Mon Dec 15, 2003 1:28 am
by madinitaly
New "release".
Now md3 tags are fully implemented, meshed are aligned properly and animation looks perfect too (but everything will need testing, of course).
Attaching a mesh to a tag is simple and reflects attaching meshes to ms3d joints:
Code: Select all
ISceneNode* tag_weapon = yourMD3AnimatedMeshSceneNode->getMD3Tag ("tag_weapon");
if (tag_weapon) tag_weapon->addChild (weaponSceneNode);
Your weapon scene node can be any type of object. You can model your weapon with anim8or, export them to .3ds and attach them to a pre-esistent md3 model!
Also, my class for giving a simple interface to load and handle complete models has grown. Here is a promising screenshot of my sample application:
(This model is "md3-tommi.pk3" and can be downloaded from Polycount website)
Here are the files:
MD3 Mesh File Loader
MD3 Model Class with sample app and win binaries
What's next? Easy interface for one-time animation loops (by linking together md3 animations).
Uh, and still there's a problem: too many obj files. I had to create a dllwrap.bat batch script to replace the list of .o files with a shorter *.o in order to avoid the "The input line is too long" issue... but maybe someone will find a simpler way to integrate this in the engine.
Posted: Mon Dec 15, 2003 6:24 pm
by hell_bird
there are still polygons missing:
try for example
this
and a loader for weapons would be really cool
its a real nice add-on...
Posted: Mon Dec 15, 2003 7:01 pm
by madinitaly
hell_bird wrote:there are still polygons missing
Uhm, I'm checking the code that does vertex indexing to create the triangles: I'm sure the problem is there.
and a loader for weapons would be really cool
Will be done
its a real nice add-on...
Thanks, and thank you for testing it!
Posted: Tue Dec 16, 2003 8:01 pm
by niko
I've announced the MD3 loader on irrlicht.sf.net, together with tokamak scene node. Madinitaly, if you need, I can also move the code to the sourceforge servers.
[I posted a similar text into the tokamak scene node thread
]
Posted: Tue Dec 16, 2003 8:56 pm
by madinitaly
Wow, thank you for the announcement, Niko!
Yes, having the code in the sourceforge page would be great and will let users find it easily.
Even if it's still unperfect (problems with some models which have multiple surfaces) I think it's already pretty enough for people who would like to start a project and use their own md3 models.
News
Posted: Wed Dec 17, 2003 9:44 pm
by madinitaly
There was a bug in the code to generate the transformation matrix for the tags. Fixed it
I'm moving the downloads to my project's homepage:
http://aitolikon.sourceforge.net/downloads.html
Niko, if you want to link them, they're on that page (so you won't need to care about updates
)
*I almost forgot: I put a pre-compiled irrlicht.dll, irrlicht.a and irrlicht.def in the CMD3MeshFileLoader download, for people who don't want to recompile the engine. Also, instructions are more detailed.