3D Lingo Dictionary > T-Z > vector()

 

vector()

Syntax

vector (x, y, z)

Description

3D data type and function; a vector describes a point in 3D space according to the parameters x, y, and z which are the specific distances from the reference point along the X axis, Y axis, and Z axis, respectively. If the vector is in world space, the reference point is the world origin, vector(0, 0, 0). If the vector is in object space, the reference point is the object's position and orientation. This function returns a vector object.

Vector values can be operated upon by the +, -, * and / operators. See their individual definitions for more information.

Examples

This statement creates a vector and assigns it to the variable MyVector:

MyVector = vector(10.0, -5.0, 0.0)

This statement adds two vectors and assigns the resulting value to the variable ThisVect:

ThisVect = vector(1.0, 0.0, 0.0) + vector(0.0, -12.5, 2.0)
put ThisVect
-- vector(1.0000, -12.5000, 2.0000)

See also

+ (addition), - (subtraction), * (multiplication), / (division)