Creates and initializes the Matrix3 to the 3x3 identity matrix.
A column-major list of matrix values.
Computes and returns the determinant of this matrix.
Sets the elements of this matrix based on an array in column-major format.
The array to read the elements from.
index of first element in the array. Default is 0.
Inverts this matrix, using the analytic method. You can not invert with a determinant of zero. If you attempt this, the method produces a zero matrix instead.
Sets the 3x3 matrix values to the given row-major sequence of values.
value to put in row 1, col 1.
value to put in row 1, col 2.
value to put in row 1, col 3.
value to put in row 2, col 1.
value to put in row 2, col 2.
value to put in row 2, col 3.
value to put in row 3, col 1.
value to put in row 3, col 2.
value to put in row 3, col 3.
Writes the elements of this matrix to an array in column-major format.
array to store the resulting vector in. If not given a new array will be created.
offset in the array at which to put the result.
Transposes this matrix in place.
Transposes this matrix into the supplied array, and returns itself unchanged.
Generated using TypeDoc
A class representing a 3x3 matrix. See the ngx3js docs page for details.
Examples
webgl / simple / gi
Code Example
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 m.set( 11, 12, 13, 21, 22, 23, 31, 32, 33 ); will result in the .elements array containing: m.elements = [ 11, 21, 31, 12, 22, 32, 13, 23, 33 ]; 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,g 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.