Link to home
Start Free TrialLog in
Avatar of Krip
Krip

asked on

Another quaternion question

How do I figure out the 'heading' vector given a certain quaternion representing the object's orientation.

Using directX I can get the rotation matrix. is there a way to do the invesre of the D3DXMatrixLookAt for the 3 vectors (or 1 of them for that matter)?

Cheers,
Krip
Avatar of joachimc
joachimc

You can go back to a rotation matrix from a quaternion

D3DXMatrixRotationQuaternion

You can also try this

D3DXQuaternionToAxisAngle

Hope this helps
Avatar of Krip

ASKER

Maybe I wasn't clear...

I have the rotation matrix, what I'm looking for is the LookAt vector i.e. the vector in the same direction as my object's 'heading'

D3DXLookAtLH takes 3 vectors lookAt, eye and up and builds a rotation matrix from them. Is There a way to do the opposite?

Cheers,
Krip

ASKER CERTIFIED SOLUTION
Avatar of limestar
limestar

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Krip

ASKER

Naturally....
Thanks