loading md3 models

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
terrorchrist
Posts: 83
Joined: Wed Apr 26, 2006 10:07 pm
Location: Vienna

loading md3 models

Post by terrorchrist »

Hi!
As adding one cal3d model lets the fps count sink from 200 to 30-20 I decided to use the md3 format instead! ^^

I just wanted to know if loading md3 meshes works since irrlicht v.1.0
or if I still have to apply the patch (which I cannot find anymore).

I also would like to know how such a model is loaded since it consists of three meshes instead of one....

please help! :!:
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Yes, you still need the patch. All loaders except for collada and anim8or are loading all file contents into one mesh, so you can only access subparts via the mesh buffers (which are not named, though).
terrorchrist
Posts: 83
Joined: Wed Apr 26, 2006 10:07 pm
Location: Vienna

Post by terrorchrist »

ok thanks hybrid!
BUT I still have a question:

How can I just load an md3 model like an md2 model? I mean I downloaded a free md3 model, and it consists of THREE md3 files!

So how on earth can this be done?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You'll have to load all three files and put them correctly using setPosition() etc. MD3 files are contained in one file usually, so you have three meshes here. Thus, positioning is up to you.
terrorchrist
Posts: 83
Joined: Wed Apr 26, 2006 10:07 pm
Location: Vienna

Post by terrorchrist »

ok thanks!
now I applied the md3.patch to the irrlicht engine 1.0 source code and cannot compile it anymore because of a linker error.
I found out that the file "CMD3MeshLoader.h" is in the engine, but the "CMD3MeshFileLoader.cpp" is NOT!
therefore it is no wonder, that the linker cannot find this "external symbol"
Error 4 error LNK2019: unresolved external symbol "public: __thiscall irr::scene::CMD3MeshFileLoader::CMD3MeshFileLoader(class irr::io::IFileSystem *,class irr::video::IVideoDriver *)" (??0CMD3MeshFileLoader@scene@irr@@QAE@PAVIFileSystem@io@2@PAVIVideoDriver@video@2@@Z) referenced in function "public: __thiscall irr::scene::CSceneManager::CSceneManager(class irr::video::IVideoDriver *,class irr::io::IFileSystem *,class irr::gui::ICursorControl *,class irr::scene::CMeshCache *)" (??0CSceneManager@scene@irr@@QAE@PAVIVideoDriver@video@2@PAVIFileSystem@io@2@PAVICursorControl@gui@2@PAVCMeshCache@12@@Z) CSceneManager.obj
SO where can I download this meshfileloader?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You have to add the file to your project/makefile as documented on the patch page. So since you're using MSVC you have to add it to your project (in the file overview, add file, probably both .cpp and .h) then it should add the loader, too.
and please remove your cross-posting to the other thread in this forum. It's not necessary, off-topic, and cross-posting in general can easily lead to being completely ignored...
terrorchrist
Posts: 83
Joined: Wed Apr 26, 2006 10:07 pm
Location: Vienna

Post by terrorchrist »

sorry - when I found out, that I posted in the wrong thread it was already too late and :oops: I didn*t know that one can actually remode one*s posts
terrorchrist
Posts: 83
Joined: Wed Apr 26, 2006 10:07 pm
Location: Vienna

Post by terrorchrist »

sorry but I cannot find any md3.patch on the
http://parsys.informatik.uni-oldenburg. ... /irrlicht/
page anymore...

has it moved?
cadue
Posts: 72
Joined: Mon Mar 13, 2006 8:33 pm
Location: Italy - Friuli - Monfalcone - Staranzano

Post by cadue »

where I can find the patch for use .md3 models in irrlicht?
excuse me for my bad english and for my ignorance...but I'm 14 and i come from Italy, where the study of english is a optional (-:
terrorchrist
Posts: 83
Joined: Wed Apr 26, 2006 10:07 pm
Location: Vienna

Post by terrorchrist »

ok now I found the patch file, but I cannot find any additional files - even in the forum thread as all links there are down

so where can I get them from? :shock:
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

:roll: :evil:
There are no additional files: Patch your sources. That creates new files. Add those to your compile project such they are compiled and linked. This depends on your compiler and project type, but if you ever made anything with a compiler you should be able to do this.
terrorchrist
Posts: 83
Joined: Wed Apr 26, 2006 10:07 pm
Location: Vienna

Post by terrorchrist »

I am so sorry hybrid!
I just didn't get it ^^
hope you can forgive me one day :cry:
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

:wink: Sure. So since you already had the scene manager patched you should also have the CMD3MeshFileLoader.cpp and CAnimatedMeshMD3.cpp
Now just look in your IDE where all those files are listed (the Irrlicht source files). then add (probably with right mouse button) these two files. Compile again and done. If not please provide the information requested.
terrorchrist
Posts: 83
Joined: Wed Apr 26, 2006 10:07 pm
Location: Vienna

Post by terrorchrist »

thanks hybrid! yo're the man ^^

now it works, but I still gotta find out how to load a model correctly, and how to position the different body parts correctly using the tags.

also I looked into the source code and didn't find any "playAnimation" function, that lets you play a specific animation. There seems to be only the possibility to play a specific frame, not even a specific frame range!
terrorchrist
Posts: 83
Joined: Wed Apr 26, 2006 10:07 pm
Location: Vienna

Post by terrorchrist »

hi!
finally found out how to achieve that!
if one applies the md3.patch a new method is also added to the IAnimatedMeshSceneNode which makes it possible to create a scenenode for a tag of the md3 model.
additionally: the setFrameLoop() and so on methods of the IAnimatedMeshSceneNode work as well for the md3 mesh!

I only have one more question:
where the hell can I get an md3 compiler from
and how can I create "tag"s in 3ds max or maya??!!!!
Post Reply