miniRT is a graphic prooject at 42 School. The aim is to realize a more or less simple ray tracer, with the following obligations :
- Draw some forms : sphere, cylinder, cone
- Materialize light : ambient, shadow and phong model
- Create some textures : chess and bitmap
BONUS features (outside of the project) :
- Anti-aliasing
- Map generator
- Turning earth generator
None
make
and ./miniRT map1 map2 map3 map4 etc.
Like ./miniRT input/classic.rt
. The rendering of map1 will be replaced by map2 as soon as it is rendered. Rendering time will appear in the terminal.
All maps are stored in input
directory.
Some of them have anti-aliasing. Just look for the line with anti-aliasing and add '-' in front of it to avoid it. Ex : -anti-aliasing 10
Inside Cylinder - in_cylinder.rt :
Playing with colored lights - colored_lights.rt :
Adding chess texture - classic.rt:
Spheres - input_long/spheres.rt :
Cylinder - input_long/cylinders2.rt :
Cyliner (without ambient light) - input_long/cylinerders.rt :
-
Library MLX (MiniLibX) : Graphical windows, images and hooks among other things. Deeper knowledge than for fdf.
-
Maths : vectors, matrixes, transformation
-
Rays : intersections, normal to the intersections
-
Light and shading : Reflection, phong models, shadows
-
Parsing: Still some parsing to do, but not so difficult
-
Optimization : Rendering is long, the more complex the projet (reflexion, refraction, scenes, etc.) the longer it takes to render.
The Ray Tracer Challenge - Jamis Buck
3D rendering : https://www.kmjn.org/notes/3d_rendering_intro.html
Download the good MLX : https://github.com/42Paris/minilibx-linux/blob/master/mlx.h
3D Rendering : https://www.scratchapixel.com/
Rotation matrix : https://gist.github.com/kevinmoran/b45980723e53edeb8a5a43c49f134724