XSIMath.CreateVector3

Description

Returns an SIVector3 object, the X, Y and Z values of this vector can be set at creation time from an array or by 3 values.

C# Syntax

SIVector3 XSIMath.CreateVector3( Object in_dX, Object in_dY, Object in_dZ );

Scripting Syntax

oReturn = XSIMath.CreateVector3( [X], [Y], [Z] );

Return Value

SIVector3

Parameters

Parameter Type Description
X Double or Array X value to set in the vector or an array containing the X, Y and Z values.
Y Double Y value to set in the vector.
Z Double Z value to set in the vector.

Examples

1. JScript Example

/* Set and display the X, Y and Z values of a vector3
*/
//CreateVector3 with array
var arrayInit = new Array (3)
arrayInit[0] = 1.1;
arrayInit[1] = 2.3;
arrayInit[2] = 3.7;
var oVec = XSIMath.CreateVector3( arrayInit );
var vbArr = new VBArray( oVec.Get2() );
var array = vbArr.toArray();
Application.LogMessage( "X, Y and Z vector's values: " + array[0] 
+" , "+ array[1] +" , "+ array[2] );
//Expected output:
//INFO : X, Y and Z vector's values: 1.1 , 2.3 , 3.7

2. VBScript Example

set oVector3 = XSIMath.CreateVector3
Application.LogMessage TypeName(oVector3)