Skip to content

ele-sage/MiniRT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MiniRT

miniRT is a simple ray tracing program designed to model images following the ray tracing protocol. The images produced represent scenes viewed from a defined angle and contain simple geometric objects, each with its own lighting system.

Requirements

  • macOS
  • glfw
  • Cmake

Features

  • Rendering of simple geometric objects: plane, sphere, and cylinder.
  • Proper handling of window management ensuring smooth transitions between windows and resolution changes.
  • Capability to modify the size of unique properties of objects, such as diameter for a sphere, and height and length for a cylinder.
  • Implementation of transformations for objects, lights, and camera: translation and rotation (excluding spheres and lights which cannot be rotated).
  • Lighting effects including brightness, shadows, and ambient light.
  • Display of images in a window with user-friendly interaction:
    • Pressing the ESC key closes the window and exits the program.
    • Clicking the close button on the window closes the window and exits the program.

Usage

Compile the program using the provided Makefile with the following commands:

make

Execute the program with a scene description file as the first argument:

./miniRT scene.rt

Scene Description Format

For detailed information on each element type and its format, refer to the provided scene description examples.

Error Handling

If any configuration issues are encountered in the scene file, the program will exit with an error message indicating the problem.

Example

Here's a minimal example of a .rt scene file:

A 0.2 255,255,255
C -50,0,20 0,0,1 70
L -40,0,30 0.7 255,255,255
pl 0,0,0 0,1,0 255,0,225
sp 0,0,20 20 255,0,0
cy 50,0,20.6 0,0,1 14.2 21.42 10,0,255
  

Notes

You can go around the scene using WASD or arrows

Demo

miniRT demo

About

Simple RayTracer written in C

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published