Page 1 of 1

Putting gun in hands of model

Posted: Tue Mar 01, 2011 4:44 am
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?

Posted: Tue Mar 01, 2011 5:41 am
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.

Posted: Tue Mar 01, 2011 4:34 pm
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?

Posted: Wed Mar 02, 2011 3:36 am
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.

Posted: Wed Mar 02, 2011 6:10 pm
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