Welcome to the Ray Tracing Project! In this project, you'll dive into the fascinating world of computer graphics, creating stunning images by simulating the way light interacts with objects. Forget about simple rasterization; it's time to explore the magic of ray tracing, where each pixel tells a story of light, shadow, and color.
└── src
├── camera
│ ├── camera.rs
│ └── mod.rs
├── cli.rs
├── main.rs
├── math
│ ├── mod.rs
│ └── vec3.rs
├── objects
│ ├── cube.rs
│ ├── cylinder.rs
│ ├── hittable.rs
│ ├── light.rs
│ ├── materials.rs
│ ├── mod.rs
│ ├── plane.rs
│ ├── scene.rs
│ └── sphere.rs
├── ray
│ ├── mod.rs
│ └── ray.rs
├── render.rs
└── utils
├── mod.rs
└── random.rs
By the end of this project, we will:
- Implement a ray tracer to render 3D scenes into 2D images.
- Create and manipulate basic geometric objects: spheres, cubes, flat planes, and cylinders.
- Change object locations and view scenes from different camera angles.
- Implement light management to include brightness and shadows.
Ray tracing simulates the way rays of light travel and interact with objects in a scene. Imagine a camera capturing an image, where rays originate from the camera, bounce off objects, and reach light sources. Each ray determines the color, shadow, reflection, and refraction of its corresponding pixel.
Our ray tracer supports:
- Objects: Sphere, Cube, Flat Plane, Cylinder
- Transformations: Change object locations and view angles
- Lighting: Adjust brightness and shadows
- Resolution: Default output at 800x600 pixels (adjustable for testing)
We will create four .ppm images demonstrating different scenes:
- A scene with a sphere.
- A scene with a flat plane and a cube with lower brightness.
- A scene with a cube, sphere, cylinder, and flat plane.
- The same as above but from a different camera angle.
https://learn.zone01dakar.sn/git/mamoundiaye/rt.git
cd rtcargo run > output.ppmcargo run > output.ppmWhen you launch the program you'll be asked the scene you want to render (the default scenes asked on the audit.)

Dive into the world of ray tracing and watch your creations come to life! 🌟✨