What is a point in homogeneous coordinates?
[x,y,z,1]^T
What is a vector in homogeneous coordinates?
[x,y,z,0]^T
Order of applying transformations in matrix form.
Right‑to‑left:
Final = T · R · S · p
How to rotate around an arbitrary point P?
Translate to origin → Rotate → Translate back
M=T(P) R T(-P)
What does the view matrix do?
Transforms world → camera space using camera basis (u, v, w) and camera position.
Steps:
- w=
(target - eye)
———————-
||target - eye||
- s= f x up
- u= s x f
- Build matrix:
ux uy uz -s.eye
vx vy vz -u.eye
-wx -wy -wx f.eye
0 0 0 1
How to compute camera basis vectors?
Clip → NDC → Screen mapping
Clip → NDC:
x_ndc = x_c/w_c
NDC → Pixel X:
pixel_x =
x_ndc+1
———— . W
2
DDA step size
Steps = max(dx, dy)
(dx and dy are change in x and y)
DDA increments
x_inc = dx/steps
y_inc = dy/steps
- Loop: x+=x_inc, y+=y_inc → round to pixel
Scanline fill rule
Count intersections with edges → odd = inside, even = outside.
For each scanline:
- Find intersections with edges
- Sort x‑values
- Fill between pairs: (x1,x2), (x3,x4)…
Edge cases in scanline fill
Painter’s algorithm
Z‑buffer algorithm
Per‑pixel depth test.
Keeps nearest fragment.
No sorting needed.
Painter’s vs Z‑buffer
Supersampling anti‑aliasing (SSAA)
Render at higher resolution → downsample.
Works with Z‑buffer
MSAA
MSAA reduces jagged edges by taking multiple depth/coverage samples per pixel but only one colour sample. It smooths triangle edges efficiently without the full cost of supersampling.
FXAA / post‑process AA
Edge detection + blur.
Fast, works after rasterisation.
Reflection mapping
Uses environment map.
Cheap, approximate, no self‑reflections.
Shadow mapping pipeline
Two‑pass rendering
Render scene from mirror → use as texture.
Accurate for planar mirrors only.
Ray tracing reflections
Recursive rays → accurate multi‑bounce reflections.
Polygon mesh representation
Implicit quadric representation
Continuity