[ODE] Rotation about two axes

Joshua Bongard bongard at ifi.unizh.ch
Fri Aug 8 13:58:01 2003


Hi,
  I've been trying to automate a way of rotating a cylinder about the
horizontal and vertical axis. The user supplies two parameters,
rotation[0] and rotation[1], which are these two rotations. The
orientation of the cylinder is then calculated as follows:

		dMatrix3 Rx, Ry, Ryx;

		dRFromAxisAndAngle(Rx,1.0,0.0,0.0,rotation[0]);
		dRFromAxisAndAngle(Ry,0.0,1.0,0.0,rotation[1]);

		dMULTIPLY0_333(Ryx,Ry,Rx);

		dBodySetRotation(body,Ryx);

The orientation is always _almost_ right, but is always off by a small
amount. Does anyone have any ideas what I'm doing wrong?

Thanks,
Josh

-----------------------------------------------------
Josh C. Bongard, Postdoctoral Associate
Computational Synthesis Lab
Sibley School of Mechanical and Aerospace Engineering
Cornell University, 191 Grumman Hall
Ithaca, NY 14850
Tel: (607) 255-0396
Fax: (607) 255-1222
jb382@cornell.edu
-----------------------------------------------------