A ray tracing engine written from scratch in C as part of the 42 curriculum, focused on understanding the mathematical and systems-level foundations of computer graphics.
The project implements a complete rendering pipeline capable of generating 3D scenes with lighting, shadows, reflections, and geometric intersections using ray tracing principles.
miniRT was an opportunity to explore how rendering engines work internally by building the core systems from first principles.
The project focused heavily on:
- linear algebra,
- ray-object intersections,
- transformation pipelines,
- lighting models,
- and spatial reasoning in 3D environments.
Rather than relying on existing rendering frameworks, the goal was to better understand the mathematics and architecture behind modern graphics systems.
Camera
↓
Ray Generation
↓
Object Intersection Tests
↓
Surface Normal Calculation
↓
Lighting & Shadow Evaluation
↓
Pixel Color Output
↓
Rendered Scene
- Spheres
- Planes
- Cylinders with caps
- Ambient lighting
- Diffuse lighting
- Specular highlights
- Hard shadows
- Configurable field of view
- Arbitrary positioning and orientation
- View transformations
- Translation
- Rotation
- Scaling
- Matrix-based object transformations
- Custom
.rtscene format - Object/material configuration
- Camera and lighting setup
Some of the most challenging parts of the project included:
- implementing reliable ray-object intersection logic,
- debugging transformation matrices,
- handling numerical precision edge cases,
- managing object-space vs world-space transformations,
- and building a clean rendering architecture entirely in C.
The mathematical side of the project — especially matrix operations, vector math, and spatial transformations — became one of the most rewarding aspects of the implementation.
Example scenes include:
- simple lighting demonstrations,
- reflective spheres,
- cylinder-based scenes,
- and more complex object compositions.
- GCC or Clang
- CMake
- GLFW / OpenGL dependencies
make./miniRT <scene.rt>Example:
./miniRT scenes/pokeball.rt- Reflections and recursive ray tracing
- Refraction and transparency
- Texture mapping
- Anti-aliasing
- BVH acceleration structures
- Multi-threaded rendering
- Simon Wied
- Frederick Charbonnier
Developed as part of the 42 curriculum.


