[ODE] Using ODE with DirectX

Michal Bacik michal at lonelycatgames.com
Wed Mar 19 02:59:02 2003


> Heres the conversion i use from ode matrices to D3DXMATRIX, and it works
> fine for me.
>
> D3DXMATRIX t;
> dReal* bMat;
> bMat = (dReal*) dBodyGetRotation(bodyID);
>
> t._11 =bMat[0];
> t._12 = bMat[4];
> t._13 = bMat[8];
> t._14 = 0;
> t._21 = bMat[1];
> t._22 = bMat[5];
> t._23 = bMat[9];
> t._24 = 0;
> t._31 = bMat[2];
> t._32 = bMat[6];
> t._33 = bMat[10];
> t._34 = 0;
>
>
>
> Tobias Thorsen

That's it - ODE uses transposed matrices, when compared to DirectX. So you
have to swap their members along diagonal.
I also noticed ODE uses quaternions with negated axis (or negated angle)
compared to what I'm used to, but regarding quaternions, I think there's no
standard in which direction the angle is measured. I other words, when I fed
ODE with my quaternions, the results were wrong, until I negated all members
of quaternion except of first.

- michal