Jump to content
  • Advertisement
Sign in to follow this  
Garra

Assimp Models

This topic is 2539 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites
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/

Share this post


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

Share this post


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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!