[ODE] dBodySetRotation problems
Jon Watte (ODE)
hplus-ode at mindcontrol.org
Fri Mar 31 14:27:03 MST 2006
adastra at inorbit.com wrote:
> I am trying to set my body/geom rotation. I am using trimesh geoms
> and I have already set the geom with the body.
First, you don't specify in your message what is actually going wrong.
Is the object rotating at all? Is it rotating, but in a wrong way that
doesn't match your scene graph? Do you get a crash or blow-up of some sort?
Second, you don't specify whether you use row vectors on the left, or
column vectors on the right. Second, you don't specify whether you use
row major or column major accessors in the library you get the matrix
out of.
If we assume OpenGL conventions, then you'd be using column vectors on
the right, with column major matrix storage, which means that
translation lives in the rightmost elements, and is stored in the
elements at index 12,13 and 14.
ODE stores the matrix differently; it still uses column vectors on the
right, but it uses row major matrices. Further, it stores a 3x4 matrix,
but only uses the left 3x3 part of it, leaving a single float of padding
at the end of each row (where translation would live in a real 3x4 matrix).
Given this information, you should be able to create the appropriate
rotation matrix, and that might fix your problem, assuming your problem
is that the body changes rotation, but doesn't change to the right angles.
Cheers,
/ h+
More information about the ODE
mailing list