Key Formulas & Equations
| 1 0 tx |
| 0 1 ty |
| 0 0 1 |
| cos θ −sin θ 0 |
| sin θ cos θ 0 |
| 0 0 1 |
| sx 0 0 |
| 0 sy 0 |
| 0 0 1 |
x' = x × f/z, y' = y × f/z
f = focal length, z = depth. Objects farther away appear smaller.
θ = angle between surface normal and light direction. Maximum brightness at θ = 0°.
Core Concepts
The sequence from 3D model to 2D image: Vertex Processing → Primitive Assembly → Rasterization → Fragment Processing → Output Merging. Each stage transforms geometric data toward final pixels.
Converting geometric primitives (lines, triangles) into pixel fragments. Algorithms: Bresenham's line, scanline fill, z-buffering for hidden surface removal.
Model (object to world), View (world to camera), Projection (camera to screen). Combined as M = P × V × M. Homogeneous coordinates enable translation as matrix multiplication.
Phong: Ambient + Diffuse + Specular. Blinn-Phong: uses half-vector for specular. PBR (Physically Based Rendering): energy conservation, microfacet BRDF, metallic-roughness workflow.
Simulating light paths: for each pixel, cast rays into scene, compute intersections, reflections, refractions, and shadows. Produces photorealistic images at high computational cost.
Core Definitions
Worked Examples
Point (3, 4) translated by (2, −1):
x' = 3 + 2 = 5, y' = 4 + (−1) = 3
Using matrix: [5, 3, 1]T = T(2,−1) × [3, 4, 1]T
Point (1, 0) rotated 90° counterclockwise:
x' = cos(90°)×1 − sin(90°)×0 = 0
y' = sin(90°)×1 + cos(90°)×0 = 1
Result: (0, 1)
Object at (10, 5, 20) with f = 500:
x' = 10 × 500/20 = 250 pixels
y' = 5 × 500/20 = 125 pixels
Practice Problems
Answer: x' = 2×4 = 8, y' = 3×5 = 15 → (8, 15)
Answer: cos(60°) = 0.5 → 50% of maximum
Answer: x' = 2×100/10 = 20, y' = 3×100/10 = 30 → (20, 30)
Answer: Orthographic: parallel projection, no depth scaling (used in CAD/engineering). Perspective: depth-based scaling, realistic visual appearance (used in games/movies).
Answer: Vertex (transform vertex positions), Fragment/Pixel (compute pixel colors), Geometry (modify primitives), Tessellation (subdivide surfaces), Compute (general GPU computation).