given a quaternion ,solve the object 3 direction

This topic is 4861 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

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 on other sites
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 on other sites
Quote:
 Original post by dotproductGet 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 on other sites
Quote:
 Original post by dotproductGet 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 on other sites
Quote:
 Original post by derek7Do you mean this?*** Source Snippet Removed ***

Yes.. that looks correct.

• What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 24
• 15
• 36
• 12
• Forum Statistics

• Total Topics
634824
• Total Posts
3019461
×