AEiE0806 Three-dimensional transformation¶
3D coordinate and matrix fundamentals¶
- A 3D point is represented in homogeneous coordinates as \([x\ y\ z\ 1]^T\).
- Standard 3D transformations use 4x4 matrices.
- Composite transformation, viewing, and projection are central exam themes.
- A 3D composite transformation is the matrix product of two or more transformations. With column vectors, the rightmost matrix acts first.
Translation by \((t_x,t_y,t_z)\):
\[
\begin{bmatrix}
1 & 0 & 0 & t_x \\
0 & 1 & 0 & t_y \\
0 & 0 & 1 & t_z \\
0 & 0 & 0 & 1
\end{bmatrix}
\]
Scaling by \((s_x,s_y,s_z)\):
\[
\begin{bmatrix}
s_x & 0 & 0 & 0 \\
0 & s_y & 0 & 0 \\
0 & 0 & s_z & 0 \\
0 & 0 & 0 & 1
\end{bmatrix}
\]
Rotation about x-axis:
\[
R_x=\begin{bmatrix}
1 & 0 & 0 & 0 \\
0 & \cos\theta & -\sin\theta & 0 \\
0 & \sin\theta & \cos\theta & 0 \\
0 & 0 & 0 & 1
\end{bmatrix}
\]
Rotation about y-axis:
\[
R_y=\begin{bmatrix}
\cos\theta & 0 & \sin\theta & 0 \\
0 & 1 & 0 & 0 \\
-\sin\theta & 0 & \cos\theta & 0 \\
0 & 0 & 0 & 1
\end{bmatrix}
\]
Rotation about z-axis:
\[
R_z=\begin{bmatrix}
\cos\theta & -\sin\theta & 0 & 0 \\
\sin\theta & \cos\theta & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & 1
\end{bmatrix}
\]
3D pipeline and projection distinctions¶
- Reflection about the xy-plane changes the sign of \(z\).
- Reflection about the yz-plane changes the sign of \(x\).
- Reflection about the xz-plane changes the sign of \(y\).
- Shear changes one coordinate in proportion to another coordinate.
- One x-shear form is \(x'=x+h_{xy}y+h_{xz}z\), with \(y'=y\) and \(z'=z\); analogous y- and z-shears also exist.
- To rotate around an arbitrary axis or point, first move to a convenient position, rotate, then move back.
Typical conceptual pipeline:
- Model coordinates.
- World coordinates.
- Viewing transformation to eye coordinates.
- Clipping in view volume.
- Projection to 2D view plane.
- Viewport mapping to screen.
| Projection | Projectors | Size with distance | Recognition cue |
|---|---|---|---|
| Orthographic | Parallel and perpendicular to view plane | Constant | Engineering drawing style |
| Oblique | Parallel but inclined to view plane | Constant depth scale distorted | Front face true shape |
| Perspective | Meet at center of projection | Farther objects look smaller | Realistic depth cue |
- Orthographic is a type of parallel projection.
- Oblique is also a parallel projection, but projectors are not perpendicular to the view plane.
- Perspective causes vanishing effects and nonuniform scale with depth.
- Isometric is a kind of axonometric parallel projection, not perspective.
Recognition cues for 3D transformation¶
- "Objects farther away appear smaller" implies perspective.
- "Front face remains true shape" suggests oblique projection.
- "Used in multiview engineering drawings" points to orthographic projection.
- "4x4 matrix" means homogeneous 3D transform, not 2D.
Common traps in 3D transformation¶
- Isometric is not perspective.
- Orthographic and oblique are both parallel projections.
- Viewing and projection are different stages.
- Reflection about a coordinate plane changes the sign of the perpendicular coordinate only.
One-step examples for 3D transformation¶
- Translating point \((1,2,3)\) by \((2,-1,4)\) gives \((3,1,7)\).
- Rotating point \((1,0,0)\) about z-axis by \(90^\circ\) gives \((0,1,0)\).
- Under orthographic projection onto the xy-plane, \((x,y,z)\) maps to \((x,y)\).
Three-dimensional-transformation revision box¶
3D transforms use 4x4 homogeneous matrices. Projection type is a favorite recognition item: orthographic and oblique are parallel, perspective uses a finite center of projection. Viewing comes before projection in the pipeline.