Sign in to follow this  
Tar

[DX9] Quaternions

Recommended Posts

Tar    140
Hello,

I have two rotation matrices and I'd like to use quaternions in order to create a smooth animation between these two matrices. In DirectX SDK I've found the following information:

[b]D3DXQuaternionRotationMatrix[/b]: Builds a quaternion from a rotation matrix
[b]D3DXQuaternionSlerp[/b]: Interpolates between two quaternions, using spherical linear interpolation

I understand I can convert my matrices to quaternions using [b]D3DXQuaternionRotationMatrix[/b] and then find interporated quaternions using [b]D3DXQuaternionSlerp[/b]. It all works fine but I could not find a function to convert quaternions back to rotation matrices. I need matrices in order to calculate a final world matrix.

How to convert a quaternion to a matrix using DX9?

Thanks,

Leszek

Share this post


Link to post
Share on other sites
SiCrane    11839
Did you try [url=http://msdn.microsoft.com/en-us/library/bb205358(v=VS.85).aspx]D3DXMatrixRotationQuaternion()[/url]?

Share this post


Link to post
Share on other sites
Tar    140
Thanks SiCrane

[color="#284b72"]D3DXMatrixRotationQuaternion is an answer to my question. I have no idea how I could miss this function.

[/color]

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