[ODE] rotation matrix

Nate W coding at natew.com
Sun Nov 3 03:10:02 2002


On Sun, 3 Nov 2002, pia dalusong wrote:

> i have a simple question:  how do you access the
> contents of the rotation matrix that the function
> dGeomGetRotation or dBodyGetRotation give out?
> I know that the pointer is only a dReal and the matrix
> i need is a dMatrix3.  How do you resolve this?
> i really need to pass that info somehow.

Have a look at the setTransform function in drawstuff.cpp, around line
325.  This shows how to use the array of values returned by a
dBodyGetRotation call to populate a matrix for OpenGL.  Note that
dBodyGetRotation returns a 4x3 matrix, so every fourth scalar is ignored
during the conversion.

-- 

Nate Waddoups
Redmond WA USA
http://www.natew.com