Matrix4x4 Matrix API Introduction
Namespace:unityengine
Description description
A Standard 4x4 transformation matrix.
A standard 4x4 transformation matrix.
A transformation matrix can perform arbitrary linear 3D transformations (i.e. translation, rotation, scale, shear etc.) an D perspective transformations using homogenous coordinates. You rarely with matrices in scripts; Most often using Vector3s, Quaternions and functionality of Transform class are more straightforward. Plain matrices is used in special cases as setting up nonstandard camera projection.
A transformation matrix can express arbitrary linear 3D transformations (such as translation, rotation, scaling, shearing, etc.) and use the homogeneous coordinate system for the projection transformation. We basically don't use matrices in scripts, and we usually use three-dimensional vectors, four-dollar numbers, and functions of transform objects directly. Use pure matrices for special occasions such as setting up a non-normalized camera projection.
Consult any graphics textbook for in depth explanation of transformation matrices.
Refer to any graph for an in-depth explanation of the transformation matrix.
In Unity, matrix4x4 are used by several Transform, Camera, Material and GL functions.
In unity, matrix4x4 objects are used by many transform,camera,matierial and GL functions.
Matrices in Unity is column major. Data is accessed As:row + (column*4). Matrices can is indexed like 2D arrays if in an expression like Mat[a, b], a refers to the row index, while B refers to T He column index (note that this is the opposite-round to Cartesian coordinates).
The Matrix in Unity uses column precedence. Data is obtained by row + (column). Matrices can be indexed in the form of a two-dimensional array, but with an expression like mat[a,b]. Where a represents the line number and B represents the column number (note that this is exactly the same as the Cartesian coordinate system).
Static variable Variables
Identity |
Returns the identity matrix (Read only). Returns the Unit matrix (read-only). |
Zero |
Returns a matrix with all elements set to zero (Read only). Returns a matrix with all elements set to zero (read-only). |
Variables variable
Determinant |
The determinant of the matrix. The determinant of the matrix. |
Inverse |
The inverse of this matrix (Read only). The inverse matrix of this matrix (read-only). |
Isidentity |
is the identity matrix? Is this matrix a unit matrix? |
This[int,int] |
Access element at [row, column]. Gets the element that corresponds to [row, column]. |
Transpose |
Returns the transpose of this matrix (Read only). Returns the transpose matrix of this matrix (read-only). |
Functions method
GetColumn |
Get a column of the Matrix. Gets a column of this matrix. |
GetRow |
Returns a row of the matrix. Returns a row of this matrix. |
Multiplypoint |
Transforms a position by the This matrix (generic) Use this matrix to transform a coordinate (point) (normal) |
multiplypoint3x4 |
Transforms a position by the This matrix (fast). Use this matrix to transform a coordinate (point) (FAST) |
Multiplyvector |
Transforms a direction by the this matrix. Use this matrix for a direction (understood by method name should be vector bar, vector contains direction and size, translator note) to transform |
Setcolumn |
Sets a column of the Matrix. Assigns a column to the matrix. |
Setrow |
Sets a row of the matrix. Assigns a line value to the matrix. |
Settrs |
Sets this matrix to a translation, rotation and scaling matrix. Turn this matrix into a translation, rotation, and scaling matrix. |
Tostring |
Returns a nicely formatted string for the This matrix. Returns a nice formatted string of the matrix. |
static method Functions
Ortho |
Creates an orthogonal projection matrix. Creates an orthographic projection matrix. |
Perspective |
Creates a perspective projection matrix. Creates a perspective projection matrix. |
Scale |
Creates a scaling matrix. Creates a scaling matrix. |
Trs |
Creates a translation, rotation and scaling matrix. Creates a translation, rotation, and scaling matrix. |
Operators operator Overloading
operator * |
Multiplies, matrices. Multiply two matrices. |
Turn http://wiki.ceeger.com/script/unityengine/classes/matrix4x4/matrix4x4
MATRIX4X4 Matrix API