Skip to content

brensant/42_miniRT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

124 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

42_miniRT

This project has been created as part of the 42 curriculum by brensant and rgomes-d.

Description

miniRT is a simple ray tracer written in C, developed as part of the 42 School curriculum. The goal of the project is to render a 3D scene described in a text file by simulating the behavior of light rays traveling from a virtual camera into the scene.

The renderer supports geometric primitives such as spheres, planes, and cylinders, along with transformations, multiple light sources, shadows, and the Phong reflection model. The bonus version also includes additional features such as object textures, checkerboard patterns, normal mapping, and other visual effects.

The project was built from scratch using only the allowed libraries and focuses on fundamental computer graphics concepts, including:

  • Ray-object intersection algorithms
  • Vector and matrix mathematics
  • Coordinate space transformations
  • Camera projection
  • Lighting and shading models
  • Shadow ray casting
  • Texture mapping
  • Surface normal manipulation

The objective of miniRT is not to compete with modern rendering engines, but to provide a practical understanding of the mathematical and computational principles behind ray tracing and image synthesis.

Instructions

  1. Clone the repository:

    git clone --recurse-submodules https://github.com/Breno-S/42_miniRT.git
  2. Move into the project directory:

    cd 42_miniRT
  3. Compile the project:

    make bonus
  4. Run the executable passing a scene as an argument:

    ./miniRT ./scenes/scene1_bonus.rt

Resources

Here are some of the most useful resources used to understand and develop this project:

General Computer Graphics and Ray Tracing Concepts

Vector Math

Lighting

Tutorials

Important

During the development of this project, AI tools (such as ChatGPT) were used as a learning aid to clarify concepts related to ray tracing and help with some math equations. Also, this README was improved with AI. All architectural decisions, implementations, and debugging were performed by the authors, and no code was copied verbatim from AI-generated sources. The project was developed with the intent of understanding and applying the underlying concepts.

About

A minimal ray tracer implementation, using minilibx.

Topics

Resources

Stars

Watchers

Forks

Packages

Contributors

Languages