[ODE] Euler angles from ODE bodies

Dane Appalsammy daneappal at comcast.net
Mon Apr 7 19:58:01 2003


This is a multi-part message in MIME format.

--Boundary_(ID_g9YZQuC2hVa+wIm1Z6zlmA)
Content-type: text/plain; charset=iso-8859-1
Content-transfer-encoding: 7BIT

All,

I am trying to integrate ODE with a 3D gaming package as a proof of concept prototype.  The 3D package uses Euler angles (pan, tilt and roll) to manipulate the orientation of each object.  I can set the ODE bodies using the Euler angles from the 3D package using dRFromEulerAnges() and dRtoQ().  I can then set the initial orientation of the ODE body using the R rotation matrix or the Q quaternion.

However, after a step of the simulation, I need to update the orientation of the objects in my 3D package.  I am limited to using Euler anges to set the pan, tilt and roll angles of each 3D object.  How do I obtain the Euler angles from the ODE body to update my objects in the 3D package?

I have done some research and found a quaternion class in the book "Physics for Game Developers" by David M Bourg (http://www.oreilly.com/catalog/physicsgame/).  Example code download is available for those interested in the class.  The quaternion class provides conversions from Euler to quaternion and from quaternion to Euler.  Can I use this class to create a quaternion from Euler angle to set the ODE body orientation and then use the class to convert the quaternion retrieved from dBodyGetQuaternion() back to Euler angles to update my 3D objects?

Thanks in advance for your help.

Dane
daneappal@comcast.net

--Boundary_(ID_g9YZQuC2hVa+wIm1Z6zlmA)
Content-type: text/html; charset=iso-8859-1
Content-transfer-encoding: 7BIT

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1141" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>All,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I am trying to integrate ODE with a 3D gaming 
package as a proof of concept prototype.&nbsp; The 3D package uses Euler 
angles&nbsp;(pan, tilt and roll)&nbsp;to manipulate the orientation of each 
object.&nbsp; I can set the ODE bodies using the Euler angles from the 3D 
package using dRFromEulerAnges() and&nbsp;dRtoQ().&nbsp; I can then set the 
initial orientation of the ODE body&nbsp;using the&nbsp;R rotation matrix or the 
Q quaternion.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>However, after a step of the simulation, I need to 
update the orientation of the objects in my 3D package.&nbsp; I am limited to 
using Euler anges to set the pan, tilt and roll angles of each 3D object.&nbsp; 
How do I obtain the Euler angles&nbsp;from the ODE body to update my objects in 
the 3D package?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I have done some research and found a quaternion 
class in the book "Physics for Game Developers" by David M Bourg (<A 
href="http://www.oreilly.com/catalog/physicsgame/">http://www.oreilly.com/catalog/physicsgame/</A>).&nbsp; 
Example code download is available for those interested in the class.&nbsp; The 
quaternion class provides conversions from Euler to quaternion and from 
quaternion to Euler.&nbsp; Can I use&nbsp;this class to create a quaternion from 
Euler angle to set the ODE body orientation and then use the class to convert 
the quaternion retrieved from dBodyGetQuaternion() back to Euler angles to 
update my 3D objects?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Thanks in advance for your help.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Dane</FONT></DIV>
<DIV><FONT face=Arial size=2><A 
href="mailto:daneappal@comcast.net">daneappal@comcast.net</A></FONT></DIV>
<DIV>&nbsp;</DIV></BODY></HTML>

--Boundary_(ID_g9YZQuC2hVa+wIm1Z6zlmA)--