Jump to content
  • Advertisement


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


Rotation Matrix

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

Look up the "Gram Schmidt algorithm" for orthonormalising any basis. Treat the rows (or the columns) as the basis vectors. The order in which you pick the first base vector will affect the final outcome though, the first one is unchanged (except that is normalised). You could calculate all possible bases produced by the algorithm, you''d have to do it 6 times though (once for each ordering of the input base vectors). Then pick the matrix which, when subtracted from the original, has least (modulus of the) determinant, i.e. min(abs(det( B_out - B_in ))).

Any orthonormal basis has the properties you describe (transpose is it''s inverse). You may need to check that the final matrix has determinant +1 rather than -1 though, otherwise you get a reflection as well (so you need to reverse one of the output base vectors).

"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

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!