Jump to content
  • Advertisement
Sign in to follow this  
derek7

given a quaternion ,solve the object 3 direction

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

or given a axis and rotate a object "angle" how to know 3 direction of a object? vector3 R = Funcion (axis,angle);

Share this post


Link to post
Share on other sites
Advertisement
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
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!