A column-major list of matrix values.
[1, 0, 0, 0, 1, 0, 0, 0, 1]
Read-only flag to check if a given object is of type Matrix.
Read-only flag to check if a given object is of type Matrix3.
Extracts the basis of this matrix into the three axis vectors provided. If this matrix is:
a, b, c,
d, e, f,
g, h, i
then the xAxis, yAxis, zAxis will be set to:
xAxis = (a, d, g)
yAxis = (b, e, h)
zAxis = (c, f, i)
This instance.
Sets the elements of this matrix based on an array in column-major format.
This instance.
the array to read the elements from.
Optional
offset: numberindex of first element in the array. Default is 0.
Sets this matrix as a 2D rotational transformation by theta radians.
The resulting matrix will be:
cos(θ) -sin(θ) 0
sin(θ) cos(θ) 0
0 0 1
This instance.
— Rotation angle in radians. Positive values rotate counterclockwise
Sets the 3x3 matrix values to the given row-major sequence of values.
This instance.
Set this matrix to the upper 3x3 matrix of the Matrix4 m.
This instance.
offset x
offset y
repeat x
repeat y
rotation, in radians. Positive values rotate counterclockwise
center x of rotation
center y of rotation
Writes the elements of this matrix to an array in column-major format.
The array param or a new instance
Optional
array: number[]array to store the resulting vector in. If not given a new array will be created.
Optional
offset: numberoffset in the array at which to put the result.
A class representing a 3x3 matrix.
Example
Remark
A Note on Row-Major and Column-Major Ordering The set() method takes arguments in row-major order, while internally they are stored in the elements array in column-major order.
This means that calling
will result in the elements array containing:
and internally all calculations are performed using column-major ordering. However, as the actual ordering makes no difference mathematically and most people are used to thinking about matrices in row-major order, the three.js documentation shows matrices in row-major order. Just bear in mind that if you are reading the source code, you'll have to take the transpose of any matrices outlined here to make sense of the calculations.