CreateQuaternion (XSIMath)

Description

Returns a SIQuaternion object, the W, X, Y and Z values of this quaternion can be set at creation time from an array or by 4 values.

Scripting Syntax

XSIMath.CreateQuaternion( [W], [X], [Y], [Z] )

C# Syntax

SIQuaternion XSIMath.CreateQuaternion( Object in_dW, Object in_dX, Object in_dY, Object in_dZ );

Parameters

Parameter

Type

Description

W

Double or Array

W value to set in this quaternion or an array containing the W, X, Y and Z values.

X

Double

X value to set in this quaternion.

Y

Double

Y value to set in this quaternion.

Z

Double

Z value to set in this quaternion.

Return Value

SIQuaternion

Examples

1. VBScript Example

set quaternion = XSIMath.CreateQuaternion
Application.LogMessage TypeName(quaternion)

2. JScript Example

/* Set and display the values of a quaternion
*/
var oQuat = XSIMath.CreateQuaternion(0.615, -0.764, -0.122, 0.152);
var vbArr = new VBArray( oQuat.Get2() );
var array = vbArr.toArray();
Application.LogMessage( "W, X, Y and Z quaterion's values: " + array[0] +","
+ array[1] +","+ array[2] +","+ array[3] );
//Expected output:
//INFO : W, X, Y and Z quaterion's values: 0.615,-0.764,-0.122,0.152


Autodesk Softimage v7.5