Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Funny rotations

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

Hi, I''m trying to create bounding boxes around my objects. Got a model class with the main mesh, and a boundingbox mesh to represent the box. In the render loop I have something like this { m_pModel->Render(); // Render the main object D3DXMATRIX matTemp; D3DXMATRIX mat; // Rotate the box D3DXMatrixRotationY( &mat, D3DXToRadian( m_heading ) ); // Put the box inplace D3DXMatrixTranslation( &mat, m_x, 30, m_y ); // Multiply the matrixes(?) D3DXMatrixMultiply( &mat, &mat, &matTemp ); ... } The result is that the boundingbox is mirrored on both x and z axis (y is always 0 in this case) If I remove the rotation and the multiply, the box is drawn correctly inplace? What did i miss on matrix multiplication? /Johan

Share this post

Link to post
Share on other sites
Solved it...

D3DXMatrixMultiply( &mat, &matTemp, &mat );

instead of

D3DXMatrixMultiply( &mat, &mat, &matTemp );

The order of the multiplication ofcourse...

Share this post

Link to post
Share on other sites

  • 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!