From 2bc7b5c58e383ea631f41d85dcfdd6e171f1e17c Mon Sep 17 00:00:00 2001 From: Krishna Ayyalasomayajula Date: Sat, 30 May 2026 20:59:18 -0500 Subject: [PATCH] docs: add coordinate space journey diagram --- docs/concepts/coordinate-systems.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/concepts/coordinate-systems.md b/docs/concepts/coordinate-systems.md index 706a55c..23c2bcf 100644 --- a/docs/concepts/coordinate-systems.md +++ b/docs/concepts/coordinate-systems.md @@ -99,3 +99,25 @@ For our triangle, every vertex follows this path: 4. **Viewport transform (automatic):** GPU scales NDC to window pixel coordinates. The triangle appears on screen. In a real 3D application, this journey includes model, view, and projection matrices before clip space. For the rainbow triangle, the journey is three steps through identity transforms. The hardware pipeline stages are the same regardless. + +```text +Vertex Buffer (NDC positions) + │ + ▼ +Vertex Shader → Clip Space (vec4, homogeneous) + │ + ▼ +[Fixed: Perspective Division: (x,y,z) ÷ w] + │ + ▼ +NDC Cube [-1,+1]×[-1,+1]×[0,1] + │ + ▼ +[Fixed: Viewport Transform: scale + translate] + │ + ▼ +Viewport/Framebuffer (pixel coordinates) + │ + ▼ +Rasterization → Fragments → Fragment Shader → Output Merge → Screen +```