# Transform¶

Category: Built-In Types

## Brief Description¶

3D Transformation.

## Member Functions¶

 Transform Transform ( Vector3 x_axis, Vector3 y_axis, Vector3 z_axis, Vector3 origin ) Transform Transform ( Matrix3 basis, Vector3 origin ) Transform Transform ( Matrix32 from ) Transform Transform ( Quat from ) Transform Transform ( Matrix3 from ) Transform affine_inverse ( ) Transform inverse ( ) Transform looking_at ( Vector3 target, Vector3 up ) Transform orthonormalized ( ) Transform rotated ( Vector3 axis, float phi ) Transform scaled ( Vector3 scale ) Transform translated ( Vector3 ofs ) var xform ( var v ) var xform_inv ( var v )

## Member Variables¶

• Matrix3 basis - The basis contains 3 [Vector3]. X axis, Y axis, and Z axis.
• Vector3 origin - The origin of the transform. Which is the translation offset.

## Description¶

Transform is used to store transformations, including translations. It consists of a Matrix3 “basis” and Vector3 “origin”. Transform is used to represent transformations of any object in space. It is similar to a 4x3 matrix.

## Member Function Description¶

Construct the Transform from four Vector3. Each axis creates the basis.

Construct the Transform from a Matrix3 and Vector3.

Construct the Transform from a Matrix32.

Construct the Transform from a Quat. The origin will be Vector3(0, 0, 0)

Construct the Transform from a Matrix3. The origin will be Vector3(0, 0, 0)

Returns the inverse of the transfrom, even if the transform has scale or the axis vectors are not orthogonal.

Returns the inverse of the transform.

Rotate the transform around the up vector to face the target.

Returns a transfrom with the basis orthogonal (90 degrees), and normalized axis vectors.

Rotate the transform locally.

Scale the transform locally.

Translate the transform locally.

• var xform ( var v )

Transforms vector “v” by this transform.

• var xform_inv ( var v )

Inverse-transforms vector “v” by this transform.