Reference : http://wenku.baidu.com/view/193f8a8fbceb19e8b8f6baf6.html
(Owed by: Spring Night rain Http://blog.csdn.net/chunyexiyu reprint please indicate the source)
Common geometric transformation matrices: translation (translate), rotation (rotate), scaling (scale), and simple compositing, such as rotation around a specified point, scaling
Multiplicative reference Http://blog.csdn.net/chunyexiyu/article/details/44671737-Matrix matrix multiplication for matrix recombination
Two-dimensional transformation matrices:
Two-dimensional translational Vec (Tx, Ty)
1 0 Tx
0 1 Ty
0 0 1
Two-dimensional rotation :
[Email protected] [Email protected] 0
[Email protected] [Email protected] 0
1 1 1
Two-dimensional amplification
Sx 0 0
0 Sy 0
0 0 1
Rotate around the vertex (Xr, Yr)
[Email protected] [Email protected] Xr ([email protected]) + [email protected]
[Email protected] [Email protected] Yr ([email protected]) –[email protected]
0 0 1
( Transform step: Pan to Origin, rotate- and-pan recovery )
Zoom in around a specified point (xr,yr)
Sx 0 Xr (1-SX)
0 Sy Yr (1-sy)
0 0 1
( transform step : pan to Origin, Zoom, Pan recovery )
Three-dimensional transformation matrix:
Panning Vec (Tx, Ty, Tz)
1 0 0 Tx
0 1 0 Ty
0 0 1 Tz
0 0 0 1
Rotate around the Z axis
[Email protected] [email protected] 0 0
[Email protected] [email protected] 0 0
0 0 1 0
0 0 0 1
Rotate around X axis
1 0 0 0
0 [email protected] [email protected] 0
0 [email protected] [email protected] 0
0 0 0 1
Rotate around the Y -axis
[email protected] 0 [email protected] 0
0 1 0 0
[email protected] 0 [email protected] 0
0 0 0 1
Three-dimensional rotation of the specified point (Xr, Yr, Zr) in general
1. pan to Origin
2. rotate to an axis x| y| Z
3. rotate around the axis
4. inverse matrix processing of rotation recovery -2
5. translation Recovery -1 inverse matrix processing
Three-dimensional scaling
Sx 0 0 0
0 Sy 0 0
0 0 Sz 0
0 0 0 1
Center scale around any point (Xr, Yr, Zr)
Sx 0 0 Xr (1-SX)
0 Sy 0 Yr (1-sy)
0 0 Sz Zr (1-sz)
0 0 0 1
( step : pan to Origin, Zoom, Pan recovery )
The wrong cut, for example, to cut a matrix into a parallelogram
x is a dependent axis
1 0 0 0
B 1 0 0
C 0 1 0
0 0 0 1
y is a dependent axis
1 A 0 0
0 1 0 0
0 C 1 0
0 0 0 1
z axis is a dependent axis
1 0 A 0
0 1 B 0
0 0 1 0
0 0 0 1
Composite
1 A1 A2 0
B1 1 B2 0
C1 C2 1 0
0 0 0 1
Geometric transformation function corresponding to OpenGL
Gltranslate/glroate/glscale/glloadidentity/glloadmatrix/glmarixmode
(Owed by: Spring Night rain Http://blog.csdn.net/chunyexiyu reprint please indicate the source)
Common geometric transformation matrices