Class Matrix

Version added: before 9.5
The Matrix class is used to represent a 4x4 transformation matrix. Matrix objects are used to transform points in 3D space.

If necessary, instances of this class can be created by:

- Local variable:
local matrix = LM.Matrix:new_local()

- Global (see Script Structure about conventions for naming globals):
XX_matrix = LM.Matrix:new()

Methods of Matrix:

Name Returns Description Ver
Identity Identity() void Set the matrix to be an identity matrix < 9.5
Invert Invert() void Invert the matrix < 9.5
Multiply Multiply(m2) void Multiplies two matrices < 9.5
Perspective Perspective(alpha, nearr, farr, aspect) void Prepend a perspective transform onto the current matrix < 9.5
Rotate Rotate(axis, angle) void Prepend a rotation onto the current matrix < 9.5
Scale Scale(sx, sy, sz) void Prepend a scale onto the current matrix < 9.5
ScaleValue ScaleValue() real < 9.5
Set Set(m2) void Set the value of a matrix by copying an existing matrix < 9.5
Transform Transform(pt) void Apply a matrix transformation to a 2D vector object < 9.5
Transform Transform(box) void Apply a matrix transformation to a bounding box object < 9.5
Transform Transform(vec) void Apply a matrix transformation to a 3D vector object < 9.5
Translate Translate(dx, dy, dz) void Prepend a translation onto the current matrix < 9.5