Assimp Models

Started by
5 comments, last by Garra 12 years, 6 months ago
I'm debating on rather to use Assimp or create my own MD5 model loader. I've been studying up on MD5 models and the main thing I'm not sure about with Assimp is if it has the ability to attach weapons to the player model.. since the game it will be added to is a FPS. Could someone possibly share some insight on the subject, it would be nice to be able to use multiple model formats without having to code multiple loaders.
Advertisement

I'm debating on rather to use Assimp or create my own MD5 model loader. I've been studying up on MD5 models and the main thing I'm not sure about with Assimp is if it has the ability to attach weapons to the player model.. since the game it will be added to is a FPS. Could someone possibly share some insight on the subject, it would be nice to be able to use multiple model formats without having to code multiple loaders.


I don't think you can modify the scene that is returned by Assimp after importing an MD5. I would use Assimp to read in the MD5 into my own scene graph hierarchy, find the transformation for the weapon and attach it that way. Either way you need to import the MD5, you may as well use Assimp.

Funny thing, I wrote a small test program a few days ago to read in the Hellknight.md5mesh and several of the animations... worked like a charm for me :D
Alright, well I guess I'll give it a shot! With Assimp you only have to make one mesh loader, and then your able to load in any model that Assimp supports without having to modify that code correct?

Alright, well I guess I'll give it a shot! With Assimp you only have to make one mesh loader, and then your able to load in any model that Assimp supports without having to modify that code correct?


it's super straight forward, just follow this link: http://assimp.sourceforge.net/lib_html/usage.html

inspect the aiScene object after importing with a debugger... you can see that it has a root node, a transform, and a set of arrays for the meshes, materials, animations, etc... the root node is a scene graph that has children that index into those arrays. basically you just traverse the tree and copy out the information that you need into your own data structures. check out the source, it comes with a very simple opengl demo. good luck!
thanks a lot.. looked over the opengl sample and didn't look to difficult to convert to DirectX10.

I have one question involving Doom 3 and MD5 models. If you or someone could answer. I was looking through the pak002 file on DOOM3 where all the models are. Then went to models/md5/weapons. In there are folders called for example shotgun_view and shotgun_world. The view ones show only the arms of the player with a shotgun in its hands and have animations for it. Does DOOM3 not load the entire model, just the arms with a gun? There are also the full models, but that would seem pointless to render since its behind the camera anyway. If this is the case then I was looking at this completely wrong and planning to render the entire model, so I wouldn't even need to attach a gun to the player model.

EDIT:
Alright so I started playing around with the arms model.. which works fine loaded with Assimp. However at the end of the barrel on the gun model it has extra vertices for some reason. Its like this no matter what I load the model with... custom MD5 loaders as well as Assimp. Image is below.

http://imageshack.us/f/829/gunhold.png/
At a guess I'd say those extra verts have something to do with a muzzle flash effect.
Are the extra vertices part of a separate mesh or submesh? If so does that mesh have a name? That might shed some light on their purpose.
thanks for the response... they seemed to have indeed been something to do with a muzzle flash. The .md5mesh file had 7 meshes 4 of which were for the flash. I just modified the model in notepad.. deleted the extra 4 meshes and changed the number of meshes to 3. It now seems to work fine.

This topic is closed to new replies.

Advertisement