A 3-by-3 matrix for linear transformations of 3D geometry.
This matrix can represent any kind of linear transformations of 3D geometry, which include rotation, scale, shear, mirroring and orthographic projection. A 3x3 matrix cannot represent translation (which requires a 3x4 matrix), or perspective projection (which requires a 4x4 matrix).
The elements of this matrix are
The element m_yx is the value on the row y and column x. You can access m_yx using the double-bracket notation m[y][x], or using the member function m.At(y, x);
The member functions in this class use the convention that transforms are applied to vectors in the form M * v. This means that "float3x3 M, M1, M2; M = M1 * M2;" gives a transformation M that applies M2 first, followed by M1 second, i.e. M * v = M1 * M2 * v = M1 * (M2 * v). This is the convention commonly used with OpenGL. The opposing convention (v * M) is commonly used with Direct3D. This class uses row-major storage, which means that the elements are packed in memory in order m[0][0], m[0][1], m[0][2], m[0][3], m[1][0], m[1][1], ... The elements for a single row of the matrix hold successive memory addresses. This is the same memory layout as with C++ multidimensional arrays.
![]() | A 3-by-3 matrix for linear transformations of 3D geometry. |
![]() | Stores the data in this matrix in row-major format. [noscript]. |
![]() | A constant matrix that has zeroes in all its entries. |
![]() | A constant matrix that is the identity. |
![]() | A compile-time constant float3x3 which has NaN in each element. |
![]() | Creates a new float3x3 with uninitialized member values. |
![]() | Converts this rotation matrix to a quaternion. |
![]() | Returns the scaling performed by this matrix. |
![]() | Computes the covariance matrix of the given set of data points. |
![]() | Returns the given element. [noscript]. |
![]() | Returns the given row. [noscript]. |
![]() | |
![]() | Returns the given column. |
![]() | |
![]() | Returns the main diagonal. |
![]() | Scales the given row by a scalar. |
![]() | Scales the given column by a scalar. |
![]() | Returns the local +X/+Y/+Z axis in world space. |
![]() | Accesses this structure as a float array. |
![]() | Sets the values of the given row. |
![]() | Sets the values of the given column. |
![]() | Sets all values of this matrix. |
![]() | Sets this matrix to equal the identity. |
![]() | Swaps two columns. |
![]() | Swaps two rows. |
![]() | Sets this matrix to perform rotation about the given axis and angle. |
![]() | |
![]() | Computes the determinant of this matrix. |
![]() | Computes the determinant of a symmetric matrix. |
![]() | Returns the adjugate of this matrix. |
![]() | Inverts this matrix using Cramer's rule. |
![]() | Solves the linear equation Ax=b. |
![]() | Returns an inverted copy of this matrix. |
![]() | Inverts a column-orthogonal matrix. |
![]() | Inverts a matrix that is a concatenation of only rotate and uniform scale operations. |
![]() | Inverts a rotation matrix. |
![]() | Inverts a symmetric matrix. |
![]() | Transposes this matrix. |
![]() | Returns a transposed copy of this matrix. |
![]() | Computes the inverse transpose of this matrix in-place. |
![]() | Returns the inverse transpose of this matrix. |
![]() | Returns the sum of the diagonal elements of this matrix. |
![]() | Orthonormalizes the basis formed by the column vectors of this matrix. |
![]() | Removes the scaling performed by this matrix. |
![]() | Transforms the given 3-vector by this matrix M, i.e. returns M * (x, y, z). |
![]() | Transforms the given 3-vector by this matrix M so that the vector occurs on the left-hand side, i.e. |
![]() | Transforms the given 4-vector by this matrix M, i.e. |
![]() | Performs a batch transform of the given array. |
![]() | Multiplies the two matrices. |
![]() | |
![]() | |
![]() | |
![]() | Unary operator + allows this structure to be used in an expression '+x'. |
![]() | |
![]() | |
![]() | |
![]() | |
![]() | Tests if this matrix does not contain any NaNs or infs. |
![]() | Tests if this is the identity matrix. |
![]() | Tests if this matrix is in lower triangular form. |
![]() | Tests if this matrix is in upper triangular form. |
![]() | Tests if this matrix has an inverse. |
![]() | Tests if this matrix is symmetric (M == M^T). |
![]() | Tests if this matrix is skew-symmetric (M == -M^T). |
![]() | Returns true if this matrix does not perform any scaling. |
![]() | Returns true if this matrix performs a reflection along some plane. |
![]() | Returns true if this matrix contains only uniform scaling, compared to the given epsilon. |
![]() | Returns true if the row vectors of this matrix are all perpendicular to each other. |
![]() | Returns true if the column vectors of this matrix are all perpendicular to each other. |
![]() | |
![]() | Returns true if the column and row vectors of this matrix form an orthonormal set. |
![]() | Returns true if this float3x3 is equal to the given float3x3, up to given per-element epsilon. |
![]() | Returns "(m00, m01, m02; m10, m11, m12; m20, m21, m22)". |
![]() | |
![]() | |
![]() | Extracts the rotation part of this matrix into Euler rotation angles (in radians). |
![]() | Returns the scale components of this matrix. |
![]() | Decomposes this matrix to rotate and scale parts. |
![]() | |
![]() | |
![]() | |
![]() | Creates a new float3x3 that rotates about one of the principal axes by the given angle. |
![]() | Creates a new float3x3 that rotates about the given axis by the given angle. |
![]() | Creates a matrix that rotates the sourceDirection vector to coincide with the targetDirection vector. |
![]() | Creates a LookAt matrix. |
![]() | Returns a uniformly random 3x3 matrix that performs only rotation. |
![]() | Returns a random 3x3 matrix with each entry randomized between the range[minElem, maxElem]. |
![]() | Creates a new float3x3 that performs the rotation expressed by the given quaternion. |
![]() | Creates a new float3x3 as a combination of rotation and scale. |
![]() | Creates a new float3x3 from the given sequence of Euler rotation angles (in radians). |
![]() | Creates a new transformation matrix that scales by the given factors. |
![]() | Creates a new float3x3 that scales points along the given axis. |
![]() | Creates a new float3x3 that performs uniform scaling by the given amount. |
![]() | Produces a matrix that shears along a principal axis. |
![]() | Creates a new matrix that mirrors with respect to the given plane. |
![]() | Creates a new float3x3 that performs orthographic projection. |