Lec 03 Transformation
Menu of this lecture
Viewing transformation
Viewing transformation: 3D -> 2D projection
Scale
Multiplying a matrix on the left corresponds to performing a row operation.
Reflection
E.g. reflection about the y-axis:
Sheer
Illustration of sheer tranformation:
Rotation
By default, the rotation is around the origin.
\(R_{45}\) refers to rotatiing 45 degrees counterclockwose about the origin.
Homogeneous Coordinates
Translation is not linear transform, so it cannot be represented in matrix form. But we don't want it to be a special case, so homogeneous coordinates are used to represent all transformations.
Add a third coordinate (w-coordinate), to represent the translation characters of points or vectors.
Affine transformations:
affine map = linear map + translation map
2D version
- 2D point: \(\begin{pmatrix}x , y , 1 \end{pmatrix}^T\)
- 2D vector:\(\begin{pmatrix}x , y , 0 \end{pmatrix}^T\)
When \(w\neq 0\), 2D point \(\begin{pmatrix}x , y , w \end{pmatrix}^T\) means \(\begin{pmatrix}x/w , y/w , 1 \end{pmatrix}^T\)
(The w-coordinate of vectors are 0, which means vectors are translation invariant. By comparison, w-coordinate of points are 1)
Use homogeneous Coordinates to represent affine translations:
Properties:
1. The last row must be 0 0 1.
2. The top-left 2×2 matrix represents a linear transformation.
3. The rightmost column represents translation.
4. Relations between points and vectors:
- vector + vector = vector
- point - point = vector
- point + vector = point
- point + point = point
Scale:
Rotation:
Translation:
Inverse transformations: \(M^{-1}\)
Esp. matrix \(R_{\theta}\) for rotation is orthogonal, so \(R_{-\theta}=R^{-1}=R^T\).
3D version
- 3D point: \(\begin{pmatrix}x , y , z, 1 \end{pmatrix}^T\)
- 3D vector:\(\begin{pmatrix}x , y , z, 0 \end{pmatrix}^T\)
Use 4×4 matrix for affine transformations.
Composing Transforms
All matrices are left-multiplied to the original coordinates, and are composed in the order of transformations from right to left.
Examples
Transformations: A1 -> A2 -> ... -> An
Matrix: \(A_n\cdots A_2A_1\begin{pmatrix}x \\ y \\ 1\end{pmatrix}\)