Matrix4
Represents a 4x4 matrix.
The most common use of a 4x4 matrix in 3D computer graphics is as a transformation matrix: translation, rotation, shear, scale, reflection, or an orthographic or perspective projection. You apply it to a vector by multiplication.
Row-major and column-major ordering: set takes its arguments in row-major order, so a literal in source reads the way you would write the matrix on paper. The values are stored in elements in column-major order. There is no element constructor; use Matrix4().set(...).
Matrices are mutable and not thread-safe; confine an instance (and any object graph holding it) to a single thread, exactly as in three.js. Most methods mutate this and return it for chaining.
Properties
Functions
Sets this matrix to the transformation composed of the given position, rotation (quaternion) and scale.
Copies the translation component of the given matrix m into this matrix's translation component.
Decomposes this matrix into its position, rotation (quaternion) and scale components and stores the result in the given objects.
Computes and returns the determinant of this matrix.
Computes and returns the determinant of this matrix assuming it is affine, saving some computations.
Extracts the basis of this matrix into the three axis vectors provided.
Extracts the rotation component of the given matrix m into this matrix's rotation component.
Returns the maximum scale value of the three axes.
Creates an orthographic projection matrix. Used internally by OrthographicCamera.updateProjectionMatrix.
Creates a perspective projection matrix. Used internally by PerspectiveCamera.updateProjectionMatrix.
Sets the rotation component (the upper-left 3x3 matrix) of this matrix to the rotation specified by the given Euler angles euler. The rest of the matrix is set to the identity. Depending on the Euler.order, there are six possible outcomes.
Sets the rotation component of this matrix to the rotation specified by the given Quaternion q. The rest of the matrix is set to the identity.
Sets this matrix as a rotational transformation around the X axis by the given angle theta (in radians).
Sets this matrix as a rotational transformation around the Y axis by the given angle theta (in radians).
Sets this matrix as a rotational transformation around the Z axis by the given angle theta (in radians).
Sets this matrix as a translation transform from the given vector v.
Sets this matrix as a translation transform.
Multiplies every component of the matrix by the given scalar s.
Pre-multiplies this matrix by the given 4x4 matrix m.
Sets the elements of the matrix. The arguments are supposed to be in row-major order.
Sets the upper 3x3 elements of this matrix to the values of the given 3x3 matrix m.
Sets the position component of this matrix from the given vector v, without affecting the rest of the matrix.
Sets the position component of this matrix from the given components, without affecting the rest of the matrix.