[ODE] Rotation about Z-axis clockwise ?

thomas.miconi@free.fr thomas.miconi at free.fr
Tue Aug 26 08:30:01 2003


Hello,  
 
when using dRFromAxisAndAngle(r, 0, 0, 1, pi / 4) to make a rotation about the 
z-axis of pi/4 radians, I obtain a final matrix whose coordinates are:  
((0.7071, -0.7071, 0) 
 (0.7071, 0.7071, 0) 
 (0, 0, 1)) 
 
I get something similar when using quaternions. 
 
According to the Rule Thumb, this seems to correspond to an indirect rotation 
about the z-axis (i.e. clockwise rotation if the z-axis points to you). 
 
I fail to understand why it shouldn't be a direct rotation ? In this case, the 
final matrix would look like : 
((0.7071, 0.7071, 0) 
 (-0.7071, 0.7071, 0) 
 (0, 0, 1)) 
which is exactly what I get in ODE when I make a rotation around the -z axis ! 
(i.e. dQ/RFromAxisAndAngle(q/r, 0, 0, -1, pi / 4) ). 
 
This is not simple pedantism; because I relied on a direct rotation, I got a 
bug in my simulation which took me 3 days to find. 
 
So is the bug in my code, in my head, or in my right hand ? 
 
Amicalement, 
Thomas  
======