Re: [Algorithms] Direction+Up vector to Axis/angle
Brought to you by:
vexxed72
|
From: Jeff L. <je...@di...> - 2000-11-22 06:45:19
|
You can convert a direction and up vector into a matrix very easily. In fact they already are two thirds of the rotation matrix. Recall that the columns of a rotation matrix define the local X,Y,and Z axes of the local frame. With the up and direction you have Y and Z. Take the cross product of those two to get X. Then use Mr. Eberly's matrix->a&a code to get your result. (Of course I am assuming a Y-up world, but you get the idea) Of course if you factor in the cross product into the matrix->a&a code you could probably optimize the whole thing a bit to give you an even more speedy routine, but that's up to you. -Jeff At 12:44 AM 11/22/2000 +0100, you 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. > >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 > > > >-- >----------------------------------------------- >Max Gilead gi...@li... >XMage library http://xmage.sourceforge.net >----------------------------------------------- >-- Sex on TV is bad. You might fall off... > > > >_______________________________________________ >GDAlgorithms-list mailing list >GDA...@li... >http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list ============================================ Darwin 3D www.darwin3d.com Game Technology Seminars www.techsem.com |