Sign in to follow this  
gcard28

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

Recommended Posts

gcard28    171
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
bzroom    647
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this