I recently studied FreeType and needed some matrix transformations. I found that I almost forgot everything I learned before, so I reviewed it and borrowed this article for my memo.
Original article: Click to open the link. Thank you!
Two-dimensional transformation matrix
If a vertex is defined as a row vector, the form of the transformation matrix can only be as follows based on the multiplication of the matrix:
P' = pt
P is the coordinate of the transformed vertex, p is the coordinate before the transformation, and T is the transformation matrix.
3D graphic Transformation
Similarly, if A 1*4 row vector is used to represent a point in the space, the transformation matrix is 4*4. The transformation method is as follows:
P' = pt
Hypothesis:
You can divide the matrix into four parts based on the functions of the 3D graphic transformation matrix:
Generation ratio, symmetry, miscut, rotation, and other basic transformations
Generate translation Transformation
Generate perspective transform S to generate full scale transformation
1. Proportional Transformation
The ratios of A, E, and J are X, Y, and Z.
2. symmetric transformationThere are three planes:
3. mistangent TransformationMiscut transformation is the basis of oblique axing.
Miscut along X with Y
Returns the Z-based tangent along X.
Miscut along y with x
Miscut along y with Z
Miscut along Z with x
Miscut along Z with Y
4. Rotation Transformation
5. Translation Transformation
The translation quantities in the L, M, and N directions are X, Y, and Z respectively.