Skip to content

fkoolhoven/miniRT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logo

Writing a raytracer in C.

About the project

A project made in accordance with the MiniRT project which is part of the Codam Core Curriculum. For this project it was mandatory to use the school's graphics library. The purpose of the project is to write a raytracer. A ray tracer is a type of graphics rendering technique that simulates the physical behavior of light to generate images. It traces the path of light rays from the eye of the observer back to the light source, calculating the color of each pixel based on the material it hits and the angle of incidence.

Features

Check the subject for all the requirements we had to meet. image
Simple geometric objects with adjustable position, rotation, size and color

image image image
Diffuse and ambient light, with adjustable color, intensity and position
Planes, cylinders, spheres
image image image
Objects intersecting, adjustable camera (position, orientation, field of view)
image image image
Different points of view, shadows
image image image
Spheres, adjustable light, shadows
image image image

Getting started

Start by cloning the repository:

git clone --recursive https://github.com/fkoolhoven/miniRT.git

Compile by using make:

make

Usage

⚠️ Please note this project was made on/for Linux! ⚠️

MiniRT takes a .rt file as input. The file describes a world/scene. For example:

./miniRT scenes/sphere.rt

describes a world with a single sphere, a camera looking at it and a light source illuminating it.

  • Use left and right arrow to change the camera position across the X-axis
  • Use up and down arrow to change the camera position across the Y-axis
  • Use P and L arrow to change the camera position across the Z-axis
  • Use A and D to change the change the camera orientation across the X-axis
  • Use W and S to change the change the camera orientation across the Y-axis
  • Use R and F to change the change the camera orientation across the Z-axis
  • Use { and } to change the change the camera field of view

Important learnings

  • Graphics programming
  • Introduction to raytracing
  • Implementing mathematical formulas in C
  • Debugging complex mathematics
  • Using an external graphics library
  • Understanding 3d space, points and vectors

Contact

See my profile page for ways to contact me!

About

Writing a raytracer in C

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published