How quentin6440/minirt works
miniRT reads one .rt scene, validates its camera, lighting, and geometry, then renders the scene in a MiniLibX window until the user exits. The graph preserves the documented sphere, plane, finite-cylinder, ambient/diffuse-lighting, and shadow capabilities. Source excerpts confirm argument handling and parsing details; rendering and event wiring are represented at the documented subsystem level because their implementations were not sampled.
Main entry points: render.c Scene renderer · main.c Program entry · intersect.c Scene intersections · runtime.c Window runtime
Components 23
Scene input
- Program entry
src/main.c - Scene loading
src/parse_file.c - Line dispatch
src/parser.c - Global elements
src/parse_elements.c - Object elements
src/parse_obj.c - Parse conversion
src/parse_utils.c
Scene model
- Scene state
include/minirt.h
Ray tracing
- Camera rays
src/ray.c - Scene intersections
src/intersect.c - Shape intersections
src/obj_sp.c - Cylinder geometry
src/obj_cl.c - Surface normals
src/normal.c - Diffuse lighting
src/light.c - Shadow checks
src/shadow.c - Color calculation
src/color.c - Vector operations
src/vec_math.c
Display runtime
- Scene renderer
src/render.c - Image output
src/mlx_utils.c - Window runtime
src/runtime.c - Window events
src/events.c
Other components
- User
- Scene file
- MiniLibX
Connections 27
- User → Program entry: starts with
- Program entry → Scene loading: loads scene
- Scene file → Scene loading: supplies text
- Scene loading → Line dispatch: parses lines
- Line dispatch → Global elements: dispatches globals
- Line dispatch → Object elements: dispatches objects
- Global elements → Parse conversion: converts values
- Object elements → Parse conversion: converts values
- Scene loading → Scene state: fills scene
- Program entry → Window runtime: starts runtime
- Program entry → Scene state: destroys scene
- Window runtime → Scene renderer: renders scene
- Scene renderer → Image output: writes pixels
- Window runtime → MiniLibX: uses windowing
- Image output → MiniLibX: displays image
- User → Window events: exits window
- Window runtime → Window events: registers handlers
- Scene renderer → Camera rays: generates rays
- Scene renderer → Scene intersections: tests scene
- Scene intersections → Shape intersections: tests shapes
- Scene intersections → Cylinder geometry: tests cylinders
- Scene renderer → Surface normals: gets normals
- Scene renderer → Diffuse lighting: computes lighting
- Scene renderer → Shadow checks: checks shadows
- Scene renderer → Color calculation: computes color
- Camera rays → Vector operations: uses vectors
- Scene intersections → Vector operations: uses vectors