This Week
- Transformation!
- Today
- Why study transformation
- 2D transformations: rotation, scale, shear
- Homogeneous coordinates
- Composing transforms
- 3D transformations
Why study transformation
- Modeling → 模型变换 translation, rotation, scaling
- Viewing → 视图变换 (3D to 2D) projection
2D transformations
- Scale: $\begin{bmatrix}s&0\\0&s\end{bmatrix}$
- Scale (Non-Uniform): $\begin{bmatrix}s_x&0\\0&s_y\end{bmatrix}$
- Reflection Matrix: $\begin{bmatrix}-1&0\\0&1\end{bmatrix}$
- Shear Matrix: $\begin{bmatrix}1&a\\0&1\end{bmatrix}$
- Rotate (about the origin (0, 0), CCW by default)
- Rotation Matrix: $\begin{bmatrix}cos\theta&-sin\theta\\sin\theta&cos\theta\end{bmatrix}$
- Linear Transforms = Matrices (of the same dimension)
Homogeneous coordinates
Why Homogenous Coordinates
- Translation cannot be represented in matrix form
- $\begin{bmatrix}x'\\y'\end{bmatrix} = \begin{bmatrix}a&b\\c&d\end{bmatrix}\begin{bmatrix}x\\y\end{bmatrix}+\begin{bmatrix}t_x\\t_y\end{bmatrix}$ → So, translation is NOT linear transform!
- But we don't want translation to be a special case
- Is there a unified way to represent all transformations? (and what's the cost?)