Matrix4
Overview
Matrix4 is a class in Aspose.3d for Typescript.
Inherits from: Matrix4.
Matrix4 offers chainable transformation methods such as translate, scale, concatenate, inverse, and transpose, and can be instantiated empty or from an existing matrix.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
m00 | number | Read | Represents the element in row 0 column 0 of the matrix |
m01 | number | Read | |
m02 | number | Read | |
m03 | number | Read | |
m10 | number | Read | |
m11 | number | Read | Represents the element in row 1 column 1 of the matrix |
m12 | number | Read | |
m13 | number | Read | |
m20 | number | Read | |
m21 | number | Read | |
m22 | number | Read | Represents the element in row 2 column 2 of the matrix |
m23 | number | Read | |
m30 | number | Read | |
m31 | number | Read | |
m32 | number | Read | |
m33 | number | Read | Represents the element in row 3 column 3 of the matrix |
determinant | number | Read | Provides the scalar determinant of the matrix |
Methods
| Signature | Description |
|---|---|
constructor() | Creates a Matrix4 initialized with the supplied 16‑element array |
constructor(matrix: number[]) | |
constructor() | |
constructor() | |
getItem(key: number) → number | Returns the element at the specified linear index |
setItem(key: number, value: number) | Assigns a value to the element at the specified linear index |
transpose() → Matrix4 | |
concatenate(m2: Matrix4) → Matrix4 | |
normalize() → Matrix4 | Returns a matrix with uniform scaling removed |
inverse() → Matrix4 | Returns the inverse of this matrix |
decompose(translation: any[], scaling: any[], rotation: any[]) | Extracts translation, scaling, and rotation components into the provided arrays |
setTRS(translation: any, rotation: any, scale: any) | Sets this matrix from translation, rotation, and scale arguments |
toArray() → number[] | Returns the matrix elements as a 16‑length number array |
identity() → Matrix4 | Resets this matrix to the identity matrix and returns it |
translate(tx: number, ty: number, tz: number) → Matrix4 | Returns a matrix translated by the given offsets |
translate(v: any) → Matrix4 | |
translate(tx: any, ty: any, tz: any) → Matrix4 | |
scale(sx: number, sy: number, sz: number) → Matrix4 | Returns a matrix scaled uniformly by the components of vector v |
scale(v: any) → Matrix4 | |
scale(sx: any, sy: any, sz: any) → Matrix4 | |
rotateFromEuler(rx: number, ry: number, rz: number) → Matrix4 | |
rotateFromEuler(v: any) → Matrix4 | |
rotateFromEuler(rx: any, ry: any, rz: any) → Matrix4 | |
rotate(angle: number, axis: any) → Matrix4 | Returns a matrix representing the rotation defined by quaternion q |
rotate(q: Quaternion) → Matrix4 | |
rotate(angle: any, axis: any) → Matrix4 | |
toString() → string | Returns a string representation of the matrix elements |
equals(other: Matrix4) → boolean | Returns true if the other matrix has identical elements |