[ODE] Mapping to OpenGL axis system

J. Perkins jason at 379.com
Wed Nov 21 12:20:02 MST 2001


Ruud van Gaal wrote:

> I'm trying to create an ODE version of my racesim, and due to my lack of 
> insight on matrices, I run into some trouble with coordinate systems. 


Ruud,

Just a guess on my part, but maybe you're building the OpenGL 
matrix wrong? Here's how I do it:

const dReal* pos = dBodyGetPosition(body);
const dReal* rot = dBodyGetRotation(body);

m[0][0] = rot[0];
m[0][1] = rot[4];
m[0][2] = rot[8];
m[0][3] = 0;
m[1][0] = rot[1];
m[1][1] = rot[5];
m[1][2] = rot[9];
m[1][3] = 0;
m[2][0] = rot[2];
m[2][1] = rot[6];
m[2][2] = rot[10];
m[2][3] = 0;
m[3][0] = pos[0];
m[3][1] = pos[1];
m[3][2] = pos[2];
m[3][3] = 1;


FWIW, I use +x right, +y forward, +z up, but that's just the 
OpenGL system rotated 90 degrees.

Jason

PS - So are *all* the r.a.s. racesims using ODE now? ;)




More information about the ODE mailing list