This project is an introduction to the beautiful world of Raytracing.
TLDR: this project consists of coding a simple RayTracer that runs with the miniLibX,
a simple X-Window (X11R6) programming API in C.
Note: program covers only mandatory requirements of the project's subject.
The program is written in C language for Linux distributions and thus needs the clang compiler and some standard C libraries to run.
1. Installing miniLibX
First, to install all miniLibX requirements, run:
$ sudo apt-get install -y libxext-dev && sudo apt-get install -y libxrandr-dev && sudo apt-get install -y libx11-dev && sudo apt-get install -y libbsd-dev && sudo apt-get install -y libssl-devThen, we'll clone the miniLibX repository, checkout to the commit that is compatible with the program and compile the library:
$ cd ~ && git clone https://github.com/42Paris/minilibx-linux.git && cd minilibx-linux && git checkout acc9a87 && makeFinally, we'll create a directory for storing miniLibX manuals:
$ cd /usr/local/man/ && sudo mkdir man1and copy the manuals to the directory we have just created:
$ sudo cp man/man1/* /usr/local/man/man1/ && sudo cp libmlx.a /usr/local/lib/ && sudo cp mlx.h /usr/local/include/To show miniLibX 's manual page, run:
$ man mlxNote: To use the miniLibX in your project, you must add the following flags:
-lbsd -lmlx -lXext -lX112. Compiling the program
To compile the program, run:
$ make3. Executing the program
To execute the program on a window, run:
$ ./miniRT <scene-file.rt>Files on the scenes folder that begins with a numeral are scene files prepared for the evaluation of the project. You can run the program with such files as argument to check all rendering possibilities implemented in the program.
Below are all images generated from scenes of this folder, including some bonus scenes.
![]() |
![]() |
![]() |
![]() |
![]() |
|---|
![]() |
![]() |
![]() |
![]() |
|---|
![]() |
![]() |
![]() |
|---|
![]() |
![]() |
![]() |
|---|
![]() |
![]() |
![]() |
|---|
![]() |
![]() |
|---|
![]() |
![]() |
|---|
























