Sign in to follow this  

given a quaternion ,solve the object 3 direction

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

Quote:
Original post by dotproduct
Get the rotation matrix, and pull out the 3 rows (direct3d) or columns (opengl) as vectors.. these vectors are your objects x,y and z axis.

PS: How did you get a user rating of 0?



I often ask some simple question with poor english expression.
but I improve now :)

Share this post


Link to post
Share on other sites
Quote:
Original post by dotproduct
Get the rotation matrix, and pull out the 3 rows (direct3d) or columns (opengl) as vectors.. these vectors are your objects x,y and z axis.

PS: How did you get a user rating of 0?


Do you mean this?

D3DXMATRIX m;
D3DXQUATERNION q;
D3DXMatrixRotationQuaternion( &m, &q );

m_x = D3DXVECTOR3( m(0,0), m(0,1), m(0,2) );
m_y = D3DXVECTOR3( m(1,0), m(1,1), m(1,2) );
m_z = D3DXVECTOR3( m(2,0), m(2,1), m(2,2) );


Share this post


Link to post
Share on other sites

This topic is 4399 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.

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