Re: [Algorithms] Direction+Up vector to Axis/angle
Brought to you by:
vexxed72
From: <ro...@do...> - 2000-11-22 06:58:40
|
Max Gilead wrote: >Joe Ante wrote: > >> > Hello! >> > >> > Question: how to convert direction and up vectors to axis/angle >> > rotation? >> http://www.magic-software.com/Source/MgcCore3D/MgcMatrix3.cpp > >Excuse me maybe stupid question but what should I use from this class? >It doesn't seem to deal with Axis/Angles except for set/get methods. My >conversion method (matrix -> a&a) I have included seems to work OK. > If you indeed have matrix-> axis angle, then your problem is essentially solved, because direction and up vector give you directly two rows (or columns, depending on your matrix convention) of the rotation matrix, the third row (or column) being their cross product. The fact that direction and up vector give you two rows of the matrix is an instance of what is THE most important defining property of transformation matrices, which you would learn in any decent course in linear algebra. BTW, the derivation of matrix -> axis angle is a bit more complicated--it is essentially an eigenvalue problem, from a little more advanced part of the linear algebra course. >Today I spent another 5 hours trying to figure out how to convert >this... damn direction/up vector to axis/angle. Help!! Maybe some code >sample? I'm stuck. > >Thanks >Max |