Sign in to follow this  
Sairon

Quaternion rotations problem

Recommended Posts

My game character has a upper and lower body which are seperated by a manually controllable bone. In local space this bone is axis aligned with the Y axis. What I want to do is rotate the lower and upper body seperately. This in order to be able to run in one direction and aim in another. So I let the lower part of the body be affected by the parent scenenode rotation, which works perfectly. However the problem arise when I want to undo the scenenode rotation on the upper body and then apply the new rotation. The rotation which describes the orientation of the upper body is in a Vector2 consisting of X & Z describing which way the upper body should face. This Vector2 describes the look direction in world space. The entire matter isn't done easier by the fact that linear algebra isn't my strongest area, and quaternions in particular. Any input appreciated.

Share this post


Link to post
Share on other sites
Why do you want to undo the scenenode rotation? I would think you would want to concatenate the lower body (scenenode) transform with the local-space upper-body transform to yield a world-space upper-body transform (which doesn't involve any 'undoing' of transforms).

Perhaps you could describe the problems you're running into in a little more detail.

Share this post


Link to post
Share on other sites
Hehe, just thinking about calculating the diffrence instead of undoing the rotations helped me solve it, thanks :)

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