[ODE] GeomRotation -> OpenGL

mal content artifact.one at googlemail.com
Fri Nov 17 15:22:59 MST 2006


Hi.

So, I'm still learning when it comes to OpenGL and especially ODE.

I don't quite understand how to use the information returned by
dGeomGetRotation() to translate to glRotatef() calls. I'm predominantly
working in 2D at the moment so I'm only really interested in rotation
around the Z axis. My math knowledge isn't advanced enough to
understand things like quaternions (to tell you the truth I'm just trying
to get to grips with the application of matrices).

I can't use plane2D yet as I'm stuck on 0.6 until I can get the SVN code
 to compile on FreeBSD, but that's for another thread.

I want to do something like:

const *dReal rot = dGeomGetRotation(g);
float zrot = to_angle(rot);

glTranslatef(xpos + (w / 2), ypos + (h / 2), 0.0);
glRotatef(zrot, 0.0, 0.0, 1.0);

(Essentially rotating around the center point of a sprite).

cheers,
MC


More information about the ODE mailing list