[Opensim-users] NPCs: Quaternions and Vector3?

Garmin Kawaguichi garmin.kawaguichi at magalaxie.com
Thu Nov 18 13:09:33 UTC 2010


Do not use quaternions to define angles in 3D.
For example quaternions are used in airplanes to solve difficult problems
(eg when they climb very vertically or when they fly over the poles); can
you imagine the pilot announcing quaternions when he chats with his co-pilot
or ground controller when he talks about the attitude of the aircraft? :)))

Do as the pilot, use the degrees of angle (not even radians!)
For LSL, use the conversion functions vectors <<===>> quaternions

Degrees to quaternions:
rRotation = llEuler2Rot(vRotxyz * DEG_TO_RAD);

Quaternions to degees:
vRotxyz = llRot2Euler(rRotation) * RAD_TO_DEG;

To avoid major problems, during the build, always ensure that the root has
as rotation <0.0, 0.0, 0.0>
Thus vRotxyz.x will be the pitch, vRotxyz.y the roll and  vRotxyz.z the
course

GCI


----- Original Message ----- 
From: bodzette Coignet
To: opensim-users at lists.berlios.de
Sent: Thursday, November 18, 2010 12:11 AM
Subject: Re: [Opensim-users] NPCs: Quaternions and Vector3?


But quaternions I'm having a hard time getting my head around and I have a
hard time coding something when I don't understand what it is.




More information about the Opensim-users mailing list