SIQuaternion.SetFromXYZAngleValues

Introduced

v3.5

Description

Sets the quaternion using X,Y,Z Euler angles (in radians).

Scripting Syntax

SIQuaternion.SetFromXYZAngleValues( x, y, z );

Parameters

Parameter Type Description
x Double X Euler angle in radians
y Double Y Euler angle in radians
z Double Z Euler angle in radians

Examples

JScript Example

// Define 2 quaternion orientations using degrees radian
        var qA = XSIMath.CreateQuaternion();
        qA.SetFromXYZAngleValues( 
                XSIMath.DegreesToRadians(0),
                XSIMath.DegreesToRadians(0),
                XSIMath.DegreesToRadians(90) );
        var qB = XSIMath.CreateQuaternion();
        qB.SetFromXYZAngleValues( 
                XSIMath.DegreesToRadians(0),
                XSIMath.DegreesToRadians(0),
                XSIMath.DegreesToRadians(180) );
        // Do a sperical linear interpolation 50% between A & B 
        // and log results.
        var qC = XSIMath.CreateQuaternion();
        qC.Slerp( qA, qB, 0.5 );
        Application.LogMessage( "Q[" + 
                qC.w + "," +
                qC.x + ", V(" + 
                qC.y + "," + 
                qC.z + ")" + 
                "]" );  
        var aXYZ = new VBArray(qC.GetXYZAngleValues2()).toArray();
        Application.LogMessage( "R(" + 
                XSIMath.RadiansToDegrees(aXYZ[0]) + "," +
                XSIMath.RadiansToDegrees(aXYZ[1]) + "," + 
                XSIMath.RadiansToDegrees(aXYZ[2]) + ")" );

See Also

SIQuaternion.GetXYZAngleValues SIQuaternion.SetFromXYZAngleValues