a refers to the row index

时间:2022-06-04 08:50:31

A standard 4×4 transformation matrix.

一个标准的4×4调动矩阵。

A transformation matrix can perform arbitrary linear 3D transformations (i.e. translation, rotation, scale, shear etc.) and perspective transformations using homogenous coordinates. You rarely use matrices in scripts; most often using Vector3s, Quaternions and functionality of Transform class is more straightforward. Plain matrices are used in special cases like setting up nonstandard camera projection.

一个调动矩阵可以表达任意的线性3D调动(例如平移,,旋转,缩放,切变等)并且使用齐次坐标系进行投影调动。我们根基上不会在脚本中使用矩阵;凡是都直接使用三维向量、四元数以及Transform东西的函数。在特殊的场合例如设置一个非标准化的摄像机投影时才使用纯粹的矩阵。

Consult any graphics textbook for in depth explanation of transformation matrices.

参考任意一本图形学对付调动矩阵的深入解释。

In Unity, Matrix4x4 is used by several Transform, Camera, Material and GL functions.

在Unity中,Matrix4x4东西被很多Transform,Camera,Matierial和Gl中的函数使用。

Matrices in unity are column major. Data is accessed as: row + (column*4). Matrices can be indexed like 2D arrays but in an expression like mat[a, b], a refers to the row index, while b refers to the column index (note that this is the opposite way round to Cartesian coordinates).

Unity中的矩阵使用的是列优先。数据通过行+(列*4)的方法获取。矩阵可以被索引为类似二维数组的形式,但是要以mat[a,b]这样的表达式。此中a代表行号,b代表列号(注意这正好与笛卡尔坐标系相反)。