The goal of this project is to learn the fundamentals of raytracing by building a CPU raytracer from scratch in C language.
MiniRT (raytracer) is the second computer graphics project in 42 school common core. The program must read .rt files (more on the file format below) and render simple scenes with camera, lights, planes, spheres, cylinders and cones (this raytracer is not triangle based so all objects are defined by it's matematical formulas).
- Camera setting
- 4 basic objects: Plane, Sphere, Cylinder, Cone
- Multiple lights, including ambient light
- Phong reflection model: Ambient + Diffuse + Specular
- Checkerboard pattern
- Bitmap diffuse textures
- Normal map textures
In order to run the program first clone the repository:
git@github.com:ferri17/miniRT.gitOpen the folder:
cd miniRT/Compile the program:
makeRun the program with a valid scene as argument(test scenes can be found in /scenes)
./miniRT scenes/_test.rt| Action | Key |
|---|---|
| Select object | Mouse left click |
| Move selected object | A,S,D,W,1,2 |
| Switch Render mode / Edit mode | M |
| Bottom screen slider | Change camera's FOV |
