[ODE] Simulator explodes on zero Quaternion normalisation

James Arthur teamonkey at gmail.com
Wed Jun 2 14:09:35 MST 2004


On Wed, 2 Jun 2004 14:26:41 +0300, George Birbilis <birbilis at kagi.com> wrote:
> 
> you can consider a quaternion to be a 3d vector of length 1, representing an
> axis in space (starting from (0,0,0) obviously), plus an angle (rotation)
> arround that axis.

Sort of. In complex number theory you can describe a 2D rotation as a
complex number of length 1 (and vice versa): for normalised complex
number Z(x,y), x = Re{Z} = cos(t), y = Im{Z} = sin(t). Quaternions
work in a similar way for three dimensional rotations, but maintain
useful mathematical properties not found in the axis-angle method you
described.

> hope I remember it OK. I think you shouldn't use dNormalize4, cause it will
> normalize the angle too. You should normalize the first 3 components (X,Y,Z)
> of the quaternion, since the 4th is in radians the rotations arround the
> X,Y,Z axis that the quaternion defines.

No. If a quat is stored as Q(q,r,s,t) it must hold that sqrt(q^2 + r^2
+ s^2 + t^2)==1 and using dNormalize4() is correct.

Cheers,

James


More information about the ODE mailing list