This 42 project is an introduction to the beautiful world of Raytracing.
It is one of the group projects in the 42 core curriculum.
Done by: hepple42 & tjensen42
Working on this project, we have noticed more and more interesting optical effects in everyday life and were constantly thinking about possible implementation in our RayTracer. Once the basic principle was implemented, it was fun to add more and more objects and functionalities. We were especially excited about implementing relatively fundamental physical laws in code.
An excellent source on raytracing which helped us a lot is Ray Tracing in One Weekend series of books by Peter Shirley. It is a really detailed step-by-step guide for implementing a path-tracer in C++.
The only supported and tested operating systems are macOS
and Ubuntu 20.04
.
For Ubuntu
it is necessary to install the GLFW library first:
sudo apt-get update && \
sudo apt-get install libglfw3 && \
sudo apt-get install libglfw3-dev
Compile and run miniRT in 3 simple steps:
git clone --depth 1 https://github.com/tjensen42/42-miniRT miniRT
cd miniRT && make
./miniRT scenes/template.rt
Example: Template
Identifier | Description | Identifier | Description |
---|---|---|---|
R |
Resolution | ls |
Light sphere |
S |
Sampling specifications | ld |
Light disc |
B |
Background | lr |
Light rectangle |
A |
Ambient light | tx |
Texture |
C |
Camera | pl |
Plane |
sp |
Sphere | ||
cy |
Cylinder | ||
tb |
Tube | ||
di |
Disc | ||
rt |
Rectangle | ||
cu |
Cuboid |
*This 42 project is written in C and in accordance to the 42 school norm.
- All variables have to be declared and aligned at the top of each function
- Each function can not have more then 25 lines
- Projects should be created with allowed std functions otherwise it is cheating