Skip to content
/ 42MINIRT Public

miniRT is a RayTracer program using the miniLibX library to create realistic images from 3D scenes. It supports geometric objects like planes, spheres, and cylinders, and implements lighting effects such as ambient and diffuse lighting. Users can manipulate the scene and camera using keyboard controls for an interactive experience.

Notifications You must be signed in to change notification settings

mzsv/42MINIRT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

miniRT - RayTracer with miniLibX

Table of Contents

  1. Overview
  2. Features
  3. User Controls
  4. How to use
  5. Screenshots
  6. Acknowledgments

Overview

miniRT is a RayTracer program that generates images of scenes using the Raytracing protocol. Each image represents a scene as seen from a specific viewpoint, defined by simple geometric objects and lighting systems. The project aims to create realistic computer-generated images using concepts of light reflection and refraction.

Features

  • Geometric Objects: Supports at least three simple geometric objects: plane, sphere, and cylinder.
  • Scene Description: Parses a scene description file (*.rt) to set up the scene with cameras, lights, and objects. Examples of *.rt files are included in maps/.
  • Transformation: Allows translation and rotation transformations for objects, lights, and cameras.
  • Lighting: Implements ambient and diffuse lighting, spot brightness, hard shadows, and ambiance lighting.
  • Window Management: Ensures fluid window management with the miniLibX library, handling window resizing and closure events cleanly.
  • Error Handling: Properly exits with error messages for any misconfiguration encountered in the scene description file.

User Controls

Move Camera - Arrow keys

  • 8 (Up): Move camera up.
  • 6 (Right): Move camera right.
  • 4 (Left): Move camera left.
  • 2 (Down): Move camera down.

Zoom In/Out:

  • +: Zoom in.
  • -: Zoom out.

Note:

  • The dimentions of the window are defined in includes/scene.h as CANVAS_WIDTH and CANVAS_HEIGHT.

How to use

  1. Clone the repository:
    git clone <repository-url>
    
  2. Compile the project:
    make
    
  3. Run the project with a test map:
    ./miniRT maps/maps/cyl_test.rt
    

Screenshots

  • Scene 1
  • Scene 2
  • Scene 3
  • Scene 4
  • Scene 5
  • Scene 6

Acknowledgements

  • The 42 School for providing the project specifications and environment.

About

miniRT is a RayTracer program using the miniLibX library to create realistic images from 3D scenes. It supports geometric objects like planes, spheres, and cylinders, and implements lighting effects such as ambient and diffuse lighting. Users can manipulate the scene and camera using keyboard controls for an interactive experience.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published