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

NameTypeAccessDescription
m00numberReadRepresents the element in row 0 column 0 of the matrix
m01numberRead
m02numberRead
m03numberRead
m10numberRead
m11numberReadRepresents the element in row 1 column 1 of the matrix
m12numberRead
m13numberRead
m20numberRead
m21numberRead
m22numberReadRepresents the element in row 2 column 2 of the matrix
m23numberRead
m30numberRead
m31numberRead
m32numberRead
m33numberReadRepresents the element in row 3 column 3 of the matrix
determinantnumberReadProvides the scalar determinant of the matrix

Methods

SignatureDescription
constructor()Creates a Matrix4 initialized with the supplied 16‑element array
constructor(matrix: number[])
constructor()
constructor()
getItem(key: number)numberReturns 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()Matrix4Returns a matrix with uniform scaling removed
inverse()Matrix4Returns 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()Matrix4Resets this matrix to the identity matrix and returns it
translate(tx: number, ty: number, tz: number)Matrix4Returns 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)Matrix4Returns 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)Matrix4Returns a matrix representing the rotation defined by quaternion q
rotate(q: Quaternion)Matrix4
rotate(angle: any, axis: any)Matrix4
toString()stringReturns a string representation of the matrix elements
equals(other: Matrix4)booleanReturns true if the other matrix has identical elements