The Math Behind Every Pixel
From rasterization to photorealistic ray tracing — master Computer Graphics concepts with interactive step-by-step visualizations. Built for CS students and 3D enthusiasts.
Module Extras
LiveGLUT Mouse Interaction
Track coordinates, capture mouse click states, and draw dynamic particle trails using GLUT's active and passive motion callbacks.
GLUT Keyboard Interaction
Capture ASCII character strokes and special function keys like arrows to rotate, translate, and interact with the teapot model dynamically.
Module 1 — Fundamentals & Rasterization
LiveBresenham's Line Algorithm
Draw pixel-perfect lines on a raster grid using only integer arithmetic. Understand why rasterization avoids floating point at the hardware level.
Midpoint Circle Algorithm
Rasterize circles efficiently using 8-way symmetry and the midpoint decision parameter — no trigonometry needed.
Scanline Polygon Fill
Fill convex and concave polygons using the scanline algorithm with an active edge table — the foundation of real-time rasterization.
Cohen-Sutherland Clipping
Clip line segments to a rectangular viewport using outcode regions — essential for any rendering pipeline that handles off-screen geometry.
Sutherland-Hodgman Polygon Clipping
Clip polygons sequentially against individual viewport edges. Reconstruct the output vertex lists stage-by-stage.
Module 2 — 2D & 3D Transformations
Live2D Transformations
Translate, rotate, and scale 2D objects using matrix multiplication. Visualize how composite transformations work and why order matters.
3D Transformations
Extend transformations into 3D space. Understand pitch, yaw, roll rotations and how 4×4 homogeneous matrices handle both rotation and translation.
Module 3 — Camera & Projections
LiveCamera & View Matrix
Position a virtual camera in 3D space with position, target, and up vectors. See how the view matrix transforms world coordinates to camera space.
Perspective Projection
Transform 3D coordinates to 2D screen space with the illusion of depth. Visualize the frustum, NDC coordinates, and how FOV affects the scene.
Orthographic Projection
Project 3D to 2D without perspective distortion — used in architectural drawings, CAD software, and isometric games. Compare directly with perspective.
Module 4 — Lighting & Shading Models
LiveFlat Shading
Compute a single color per polygon face using the face normal. The simplest shading model — fast but produces visible polygon boundaries.
Gouraud Shading
Smooth shading by computing color at vertices and interpolating across the polygon. Eliminates harsh face boundaries seen in flat shading.
Phong Shading Model
The standard illumination model combining ambient, diffuse, and specular components. Understand each term visually and why the specular exponent controls glossiness.
Module 5 — Advanced Rendering
Coming SoonRay Tracing
Simulate the physical path of light by casting rays into a scene and computing intersections with geometry. The algorithm behind modern photorealistic rendering engines.
Fragment Shaders (GLSL)
Write GPU programs that compute color per pixel. From procedural gradients to noise-based textures — understand how modern GPUs produce complex visual effects.
Coming SoonShadow Mapping
Render the scene from the light's perspective to create a depth map, then use it to determine which fragments are in shadow. The standard real-time shadow technique.
PlannedTrack Our Progress
Computer Graphics visualizers are actively being designed. Check the roadmap to see what's coming and vote for what gets built next.