Putting gun in hands of model

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.
Post Reply
Rocko Bonaparte
Posts: 48
Joined: Tue Aug 31, 2010 6:27 am

Putting gun in hands of model

Post by Rocko Bonaparte »

Assuming I've loaded a MD2 model and can animate it find, how to I get the gun model loaded and lined up with the model? I have a separate md2 and pcx file for the model and the skin. So after I get it imported in, how do I make sure they line up?
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Post by Lonesome Ducky »

You'll have to animated the gun to fit the md2. The md2 has almost no information that would be able to attach a weapon. You would need a skeletal animation based format to do so.
Rocko Bonaparte
Posts: 48
Joined: Tue Aug 31, 2010 6:27 am

Post by Rocko Bonaparte »

So I have to hope the gun that came along with this might be animated so it almost accidentally follows along in the model's hands? How did Quake2 do it anyways for player models? IIRC that was the only place where the weapon could change but I believe the player models would update based on the weapon in their hands.

Edit: I looked at the model in blender and it actually had a gun already. Yet when I load it up in Irrlicht it's invisible. Could that be an issue of needing a second material?
Whirled Peas
Posts: 47
Joined: Mon Jan 10, 2011 8:01 pm
Location: SoCal

Post by Whirled Peas »

My experience in Irrlicht with animated characters is virtually nonexistent. However, from what I gather, using a .b3d model format is considered the standard for irrlicht, and Blender already is capable of outputting .b3d models. The .b3d is capable of storing animations and all sorts of other goodies, so in my highly unqualified opinion, I would recommend using that.

From there, it's a simple case of parenting the weapon to either the hand or arm bone for your character and then animating from there. Panda3d requires you to 'expose' the bone in question first before you give it a child though, but I'm not sure if that is required in Irrlicht.

Hope this helps.
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Post by hendu »

At least MD3 attaches the weapons via a tag (named point). Not sure whether MD2 is the same, or if Irrlicht exposes this info.

http://www.misfitcode.com/misfitmodel3d ... .html#tags
Post Reply