quote:
Original post by jobless
The derivative of an orientation quaternion is:
dQ/dq = 1/2 * omega * q;
where omega is the quaternion (omega.x, omega.y, omega.z, 0)
It''s just a formula; I can''t explain it. If it doesn''t work, make sure you normalize q after the euler step:
q += dq * (t1-t0);
Normalize(q);
Thanks for the reply! I also don''t know how this formula comes out, but in theory |omega| says how much the object rotates in a second and that is the value what we are looking for in dydt, not?
Although I normalize q after the euler/rk4 step it doesn''t work

I am really perplexed why it doesn''t work! It just simply doesn''t rotate the object.
That is what I am doing at the moment:
The angular momentum is 1/3 so it should rotate one round for 3 seconds. I set up the inertia tensor correctly for the 10x10x10 box.
In dydt:
Matrix4 R = Rotation;
Iinv = R * IbodyInv * R.Transpose();
omega = Iinv * Momentum;
...
Return s.Rotation = Quaternion(omega.x,omega.y,omega.z,0)*0.5*Rotation;
After returning the derivatives I multiply the current Rotation with the returned s.Rotation with the quaternion multiplication.
Is this the correct way how I should do that? (the matrix and quaternion operations are good I suppose, because they worked in a lot of situations so far...)
Thanks!
-- tSG --