t3d. Matrix3

The 3x3 matrix class.

Constructor

new Matrix3()

Create a 3x3 matrix.

Methods

clone() → {t3d.Matrix3}

Creates a new Matrix3 and with identical elements to this one.
Returns:
Type: 
t3d.Matrix3

copy(m) → {t3d.Matrix3}

Copies the elements of matrix m into this matrix.
Parameters:
NameTypeDescription
mt3d.Matrix3
Returns:
Type: 
t3d.Matrix3

fromArray(array, offsetopt) → {t3d.Matrix3}

Sets the elements of this matrix based on an array in column-major format.
Parameters:
NameTypeAttributesDefaultDescription
arrayArray.<Number>
offsetNumber<optional>
0
Returns:
Type: 
t3d.Matrix3

getInverse() → {t3d.Matrix3}

Take the inverse of the matrix
Returns:
Type: 
t3d.Matrix3

identity() → {t3d.Matrix3}

Resets this matrix to the 3x3 identity matrix
Returns:
Type: 
t3d.Matrix3

inverse() → {t3d.Matrix3}

Take the inverse of this matrix
Returns:
Type: 
t3d.Matrix3

isIdentity() → {Boolean}

Checks if the matrix is an identity matrix.
Returns:
- True if the matrix is an identity matrix, false otherwise.
Type: 
Boolean

multiply(m) → {t3d.Matrix3}

Post-multiplies this matrix by m.
Parameters:
NameTypeDescription
mt3d.Matrix3
Returns:
Type: 
t3d.Matrix3

multiplyMatrices(a, b) → {t3d.Matrix3}

Sets this matrix to a x b.
Parameters:
NameTypeDescription
at3d.Matrix3
bt3d.Matrix3
Returns:
Type: 
t3d.Matrix3

premultiply(m) → {t3d.Matrix3}

Pre-multiplies this matrix by m.
Parameters:
NameTypeDescription
mt3d.Matrix3
Returns:
Type: 
t3d.Matrix3

set(n11, n12, n13, n21, n22, n23, n31, n32, n33) → {t3d.Matrix3}

Sets the 3x3 matrix values to the given row-major sequence of values.
Parameters:
NameTypeDescription
n11Numbervalue to put in row 1, col 1.
n12Numbervalue to put in row 1, col 2.
n13Numbervalue to put in row 1, col 3.
n21Numbervalue to put in row 2, col 1.
n22Numbervalue to put in row 2, col 2.
n23Numbervalue to put in row 2, col 3.
n31Numbervalue to put in row 3, col 1.
n32Numbervalue to put in row 3, col 2.
n33Numbervalue to put in row 3, col 3.
Returns:
Type: 
t3d.Matrix3

setFromMatrix4(m) → {t3d.Matrix3}

Sets the matri3 planes from the matrix4.
Parameters:
NameTypeDescription
mt3d.Matrix4
Returns:
Type: 
t3d.Matrix3

setUvTransform(tx, ty, sx, sy, rotation, cx, cy) → {t3d.Matrix3}

Set the transformation matrix of uv coordinates
Parameters:
NameTypeDescription
txNumber
tyNumber
sxNumber
syNumber
rotationNumber
cxNumber
cyNumber
Returns:
Type: 
t3d.Matrix3

toArray(arrayopt, offsetopt) → {Array.<Number>}

Writes the elements of this matrix to an array in column-major format.
Parameters:
NameTypeAttributesDefaultDescription
arrayArray.<Number><optional>
offsetNumber<optional>
0
Returns:
Type: 
Array.<Number>

transform(x, y, scaleX, scaleY, rotation, anchorX, anchorY) → {t3d.Matrix3}

Transform 2D
Parameters:
NameTypeDescription
xNumberposition.x
yNumberposition.y
scaleXNumberscale.x
scaleYNumberscale.y
rotationNumberrotation
anchorXNumberanchor.x
anchorYNumberanchor.y
Returns:
Type: 
t3d.Matrix3

transpose() → {t3d.Matrix3}

Transposes this matrix in place.
Returns:
Type: 
t3d.Matrix3