Jump to content
  • Advertisement
Sign in to follow this  
gcard28

Attaching object to a bone in a skeleton... A BIG HEADACHE

This topic is 4235 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

Ok I am attempting to attach a gun to a bone in a skeleton. The axes that I am using are as follows: http://www.flickr.com/photos/63376021@N00/323279164/ So the main model is looking down the +Z axis. Also the gun I wish to attach is also looking down the +Z axis.. Now here are the axes for the bone I wish to attach the gun to: http://www.flickr.com/photos/63376021@N00/323279166/ I am sure you can already see the problem. When I attach to the bone, the gun follows this bone's orientation. So while the main body is facing forward the gun is facing sideways with respect to the body, since it is tracking the orientation of the bone. My problem is how do I make the gun face in the direction of the body but still track the bone it is attached to? It seems like these are conflicting requirements. I've bashed my head over this and can't seem to come up with a valid solution. I can't just modify the bone to get the proper orientation as it will throw the skinning out of wack. I'd greatly appreciate any help anyone can give me... THanks in advance

Share this post


Link to post
Share on other sites
Advertisement
You can either re-orient the gun model in modeling software to align with your character, or your'll need a transformation matrix between the bone and the gun.

So, drawing the gun like this

ModelMatrix = BoneX
DrawGun

You'd do

ModelMatrix = Re-orientMatrix * BoneX
DrawGun

You should just model everything the same coordinate system so that everything aligns the same in your game.

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!