Row matrix and column matrix

What is a row matrix and what is a column matrix

Row matrix

r11 r12 r13 0
r21 r22 r23 0
r31 r32 r33 0
tx  ty  tz  1

In fact, remember the row matrix, as long as you remember the matrix, the three components that represent the translation are in a row is the row matrix. The row matrix needs to be multiplied by the vector to complete the change, which is Vector4 Mat. Generally, in order to save the memory overhead of matrix storage, we only store the left part 4 3, the default last column is 0 0 0 1

Column matrix

r11 r21 r31 tx
r12 r22 r32 ty
r13 r23 r33 tz
0   0   0   1

The column matrix is ​​actually a transposition of the row matrix, so that the three components of the translation are in one column, which is the column matrix. The column matrix needs to be multiplied by the vector to complete the change, which is Mat Vector4. Generally, in order to save the memory overhead of matrix storage, we only store the upper 3 4 parts. By default, the last row is 0 0 0 1

Several commonly used transformations correspond to the matrices in DirectX and OpenGL. The left side of the figure below is the matrix in DirectX and the right side is the matrix in OpenGL.
Translation transformation

For the translation transformation, if DirectX is used, then m41, m42, and m43 respectively correspond to three translation components, corresponding to the following Tx, Ty, and Tz.

Rotate around X axis

Rotate around Y axis

Rotate around Z axis

Scaling transformation

Scaling transformation matrix, the two are consistent, because the transformation factors of the scaling transformation are on the diagonal of the matrix, so the transposed matrix is ​​equal to itself.

Reference link:
https://www.cnblogs.com/moxiaotao/p/11205082.html
https://www.cnblogs.com/graphics/archive/2012/08/02/2616017.html
https: //blog.csdn .net / a497406594 / article / details / 102888070

Guess you like

Origin www.cnblogs.com/xeclass/p/12695418.html