- This mini-project is the first step to create a Raytracing program, for you to finally be able to render computer-generated images.
- The program traces rays from one camera to n objects, the objects have shading and cast shadows on each other based the position of a single source of light.
- RTv1 takes as input a custom file format based on comma separated values (examples found in the scenes folder), from the file it can get these informations:
- camera (location and direction);
- light (location);
- objects:
- sphere (color, location and radius);
- cylinder (color, location, axis and radius);
- cone (color, location, axis and angle);
- plane (color, normal and distance from 0,0,0);
To generate an executable for this project run make in the root of the project directory after you've downloaded or cloned it.
This project will only work on MacOS El Capitan/Sierra/HighSierra and even then, no promises!
Run the following commands:
- To compile
make
- To remove objects:
make clean
- To remove objects and binary file (program):
make fclean
- To re-compile:
make re
this program was created without much help from standard libraries, these are all the standard function used:
- open
- read
- write
- malloc
- free
- math:
- sin()
- cos()
- pow()
- mlx graphic library:
- to create a window
- use keyboard input
Under the construction
Camere
camera <look from> <look at>
light
light <position> <color>
Sphere
sphere <position> <translation> <rotation> <color> <raduis>
Plane
plane <position> <translation> <rotation> <color> <norme>
Cylindre
cylindre <position> <translation> <rotation> <color> <raduis> <axis>
Cone
cone <position> <translation> <rotation> <color> <raduis> <axis>
- screen1
- screen2
- screen3
- screen4
- screen5
- Introduction to Ray Tracing: a Simple Method for Creating 3D Images
- Introduction to Ray Tracing and a simple raytracer with C
- Raytracing with one week
- Introduction to raytracing, it should give you the idea how things work.
- How to deal with vectors
- Ray Tracing From Scratch in Python
- Objects intersection with hugi
- How to rotate figure in 3D
- A-Level Further Maths C3-24 3D Matrices: Deriving the General Rotation Matrices