MD3 Mesh Format Loader

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
madinitaly
Posts: 92
Joined: Sat Nov 29, 2003 8:30 pm
Contact:

MD3 Mesh Format Loader

Post by madinitaly »

Strangely enough, it works :D 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. :wink:
sirshane
Posts: 31
Joined: Tue Oct 14, 2003 5:02 am
Contact:

Post by sirshane »

Sounds great. Thanks for the contribution, this is definately something I know I would find useful. :D
-Shane
madinitaly
Posts: 92
Joined: Sat Nov 29, 2003 8:30 pm
Contact:

"Release"

Post 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).
stampsm
Posts: 142
Joined: Mon Nov 10, 2003 5:52 pm
Location: Las Vegas

Post 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
Spartacus
Posts: 70
Joined: Fri Nov 21, 2003 11:56 pm

Post by Spartacus »

Nice now we can use a more "up to date" file format to load objects.
yo

Post by yo »

Congratulation Madinitaly

pit
madinitaly
Posts: 92
Joined: Sat Nov 29, 2003 8:30 pm
Contact:

New release

Post 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 :wink:
madinitaly
Posts: 92
Joined: Sat Nov 29, 2003 8:30 pm
Contact:

0.4.2

Post by madinitaly »

These will work with Irrlicht 0.4.2:

CMD3MeshFileLoader-latest.zip
CMD3Model.zip
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

Very cool, and useful. Wow, the 0.4.2 was fast! Impressive! :)
madinitaly
Posts: 92
Joined: Sat Nov 29, 2003 8:30 pm
Contact:

We're almost there!!!

Post by madinitaly »

New "release". :D
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:
Image
(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
:wink:


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.
hell_bird
Posts: 18
Joined: Mon Nov 03, 2003 12:30 pm

Post 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... 8)
madinitaly
Posts: 92
Joined: Sat Nov 29, 2003 8:30 pm
Contact:

Post 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 :wink:
its a real nice add-on... 8)
Thanks, and thank you for testing it!
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post 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 ;)]
madinitaly
Posts: 92
Joined: Sat Nov 29, 2003 8:30 pm
Contact:

Post by madinitaly »

Wow, thank you for the announcement, Niko! :wink:
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.
madinitaly
Posts: 92
Joined: Sat Nov 29, 2003 8:30 pm
Contact:

News

Post by madinitaly »

There was a bug in the code to generate the transformation matrix for the tags. Fixed it 8)

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.
Post Reply