[ODE] rotation

Ed Jones ed.jones at oracle.com
Tue Nov 5 03:22:01 2002


Hi,

So you are doing this;

Get the rotation of "bodyID".
Copy that into another matrix.
Use that matrix to set the rotation of "bodyID"

I think I'm misunderstanding what you're trying to do.

My example code, which was nabbed directly from drawstuff does this;

Gets the rotation of a body according to ODE
Copies that ODE flavoured matrix to an OpenGL matrix
Sets the OpenGL transform so that the box (or whatever) gets drawn in 
its "correct" place, according to ODE

What is the effect you're trying to achieve?

Cheers,
Ed.


pia dalusong wrote:

>hello,
>
>again...  sorry people.  i really don't get what i'm
>doing wrong or why my rotation matrix doesn't work.
>
>i have two variables:
>dMatrix3 mobot_rotation 
>const dReal *mobot_rot
>
>i use the following code to pass the rotation matrix
>
>mobot_rot = dBodyGetRotation(bodyID)
>mobot_rotation[0]=mobot_rot[0]
>...
>mobot_rotation[11]=mobot_rot[11]
>
>dBodySetRotation(bodyID, mobot_rotation)
>
>it doesn't work? the bodies end up rotated wrong.
>
>i also tried to use the same technique as the
>settransform function in drawstuff.cpp
>
>mobot_rotation[0]=mobot_rot[0]
>mobot_rotation[1]=mobot_rot[4]
>...
>mobot_rotation[11]=0
>
>and it still didn't turn out right. 
>
>please help.  i really need to solve this problem.
>
>
>__________________________________________________
>Do you Yahoo!?
>HotJobs - Search new jobs daily now
>http://hotjobs.yahoo.com/
>_______________________________________________
>ODE mailing list
>ODE@q12.org
>http://q12.org/mailman/listinfo/ode
>  
>