[ODE] Simulator explodes on zero Quaternion normalisation

George Birbilis birbilis at kagi.com
Wed Jun 2 14:26:41 MST 2004


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. So in effect a quaternion is a custom rotation (instead
of giving Euler angles or rotations arround X,Y,Z axis [in which case the
order of rotation X,Y,Z, or Z,Y,X or Y,Z,X etc. is important])

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. Try calling dNormalize3 on the
quaternion pointer or some normalize func made for quaternions (search the
ODE math libs)

cheers,
George

-----
George Birbilis (birbilis at kagi.com)
http://www.kagi.com/birbilis
--------------

> > Tracing the error back in the debugger it appears that the call to
> > dNormalize4 is being made from within moveAndRotateBody and is being
> > done so to normalise the quaternion associated with the body.  Now at
> > this point the trail goes dead for me as I don't really understand what
> > a quaternion is,
>
> A quaternion, in this context, is a 4-dimensional vector with length == 1
> which represents an orientation in 3-dimensional space.
>
> > why it should not be zero and why,
>
> Only quaternions with length == 1 represent valid orientations.
>
> > crucially, it is
> > zero in this context.
> >
>
> Here I can't help you, sorry.
>
> -- 
> Gary R. Van Sickle
>
>
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
>



More information about the ODE mailing list