Object Hierarchy | Related C++ Class: CQuaternion
A 4-element unit quaternion represented by double precision floating point w,x,y,z coordinates. A quaternion is a compact and convenient way to represent orientations and rotations in 3D space.
var oRotation = XSIMath.CreateRotation( XSIMath.DegreesToRadians( 90 ), 0, 0 ) ;
var oQuaternion = XSIMath.CreateQuaternion() ;
oRotation.GetQuaternion( oQuaternion ) ;
Application.LogMessage( "Quaternion for 90 degree x rotation is "
+ oQuaternion.W + ","
+ oQuaternion.X + ","
+ oQuaternion.Y + ","
+ oQuaternion.Z ) ;
//Output:
//INFO : Quaternion for 90 degree x rotation is 0.7071067811865476,0.7071067811865475,0,0
|