Sign in to follow this  
derek7

given a quaternion ,solve the object 3 direction

Recommended Posts

dotproduct    180
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?

Share this post


Link to post
Share on other sites
derek7    100
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
derek7    100
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

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