Geometric Transformations¶
Transformation¶
As all objects are eventually represented using points, it is sufficient to know how to transform points.
-
Translation: a rigid body transformation, translation or shift vector \((T_x,T_y,T_z)\)
-
Scaling: Scale factor \((S_x,S_y,S_z),x\rightarrow x*S_x\)
- 缩放是以原点为中心的缩放,缩放前后物体中心会变化,除非物体中心在原点。是对整个空间的缩放
- 不改变中心的缩放:将中心先移动到原点再缩放再平移回去
-
Rotation: also a rigid body transformation

- rotate around \((x_r,y_r)\):先平移将参考点移动到原点,再旋转,再平移回去

-
Shearing: produce shape distortions
- shearing in x-direction: \(x\rightarrow x+ay,y\rightarrow y,z\rightarrow z\)
-
General Linear Transformation: 用矩阵统一表示上述变换
- homogeneous coordinates: \((x,y,z,w)\) represents \((x/w,y/w,z/w)\) in Cartesian coordinates

-
Matrix Notations and Representations
- column vector \(P_h\) represents point \(P(x,y,z)\)
- a transformation is represented by a \(4\times 4\) matrix \(M\)
- 可以用一个矩阵来表示要完成的变换(因为每次变换矩阵相乘也是相同规模的)





- 注意以y为转轴时的符号
- Rotation about an arbitrary axis


- Quaternion:四元数
Transformations in OpenGL¶
-
The transformation matrices appear in reverse order to that in which the transformations are applied. In OpenGL, the transformation specified most recently is the one applied first.
-
Matrix Stacks
glPushMatrix(void);
glPopMatrix(void);
Non-linear tranformation¶
- No Distortion
- Barrel Distortion
- Pincushion Distortion
