Original Post
Hi, Has anyone had any success rendering ODE scenes / simulations using OpenGL? I'm having some moderate success but I've noticed some odd behavior when drawing cuboid shapes :( In some cases they render fine but in other cases a cube will end up like this: http://img258.imageshack.us/my.php?image=wrongha0.png It's annoying me because the other cube has landed fine and has wobbled on the blues spheres before coming to rest on the ground. Because ODE sets it's coordinates in the centre of an object, I'm drawing the quads for the cube with the top left corner as the reference point. So x, y and z define the object's centre in ODE, I calculate the OpenGL x, y and z as:
float x = GetX() - (width / 2.0f);
float y = GetY() + (height / 2.0f);
float z = GetZ() - (length / 2.0f);
I get the rotational matrix from ODE (which is in mathematical ordering) and convert it to a 4x4 OpenGL suitable matrix. I build a complete transformation matrix by plugging in x, y and z. When drawing a cube, I do a glMultMatrixf(convertedMatrix); before specifying the vertices. Everything is driven from ODE, the only user input is actually starting the simulation. It's annoying the hell out of me. Has anyone had any luck with using OpenGL in this case?