miniRT
A basic ray-tracing engine.
Description
It is a 42 school project, developped in C with the school graphic library, the minilibx.
You can generate static scenes composed of plans, sphere or cylinders. There can be several light sources, with different colors.

Getting Started
Dependencies
- A Linux distribution
- X11
Installing
git clone git@github.com:WickiRiama/miniRT.git
Executing program
- Go into the minirt folder created by the
git clonecommand. - Make the project
- Run the miniRT executable created with one of the scenes in the scenes folder.
cd minirt
make
./miniRT scenes/caterpillar.rt
Generating new scenes
- Create a new .rt file in the scenes folder.
- Add the mandatory elements
- Add an ambiant light:
A 0.6 250,250,250.0.6is the ambiant lighting ratio (in range [0.0, 1.0]) and250,250,250the RGB color (in range [0, 255]).
- Add a camera:
C 0,6,-30 0,0,1 70.0,6,-30are the x,y,z coordinates of the camera position,0,0,1the orientation vector and70the horizontal field of view (FOV, in range [0, 180]).
- Add a main light:
L 0,6,-23 0.6 255,60,60.0,6,-23are the x,y,z coordinates of the main light position,0.6the main light brightness ratio (in range [0.0, 1.0]) and255,60,60the RGB color (in range [0, 255]).
- Add an ambiant light:
- Add other elements as you wish amongst:
- spheres:
sp 0,0,0 2 115,61,19.0,0,0are the x,y,z coordinates of the sphere center position,2the sphere diameter and115,61,19the RGB color (in range [0, 255]).
- planes:
pl 0,-1,0 0,1,0 241,222,207.0,-1,0are the x,y,z coordinates of one point of the plane,0,1,0the coordinates of a normal vector of the plane and241,222,207the RGB color (in range [0, 255]).
- cylinders:
cy 7,5,-7 0,1,0 2 10 180,183,184.7,5,-7are the x,y,z coordinates of the cylinder center position,0,1,0the coordinates of a cylinder axis vector,2the cylinder diameter,10the cylinder height and180,183,184the RGB color (in range [0, 255]).
- other lights:
l 30,6,0 0.4 60,255,60.30,6,0are the x,y,z coordinates of the light position,0.4the main light brightness ratio (in range [0.0, 1.0]) and60,255,60the RGB color (in range [0, 255]).
- spheres:
Acknowledgments
This project was a team project, realized with lmenigau.
42 School graphic library: minilibx