[ODE] Quaternion/Rotation problem?

sean@blackscreen.org sean at blackscreen.org
Wed Apr 24 09:47:01 2002


Looks to me like you got back the exact same
quaternion.  Its just that your printf is rounding the
values to 3 decimal places.


On Wed, 24 April 2002, David Jung wrote
> 
> If I execute this code: 
> 
>   q[1] = 0.00074993; q[2] = 0.000499856; q[3] =
0.000499856; q[0] = 
> 0.999999; // x,y,z,w
>   dBodySetQuaternion(bodyID, q);
>   const dReal* R = dBodyGetRotation(bodyID);
>   dBodySetRotation(bodyID, R);
>   const dReal* oq = dBodyGetQuaternion(bodyID);
>   printf("Got back %5.3f %5.3f %5.3f
%5.3f\n",oq[1],oq[2],oq[3],oq[0]);
> 
> I get:
> Got back 0.001 0.000 0.000 1.000
> 
> which is not the same Quaternion (and doesn't
represent the same
> orientation - or even a valid one [shouldn't it be
unit length?]).
> 
> Is it me or is there something amiss here?
> Cheers,
> -David.
> 
> _______________________________________________
> ODE mailing list
> ODE@q12.org
> http://q12.org/mailman/listinfo/ode