Skip to content

a-cha/raytracing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ray Tracing

My first RayTracer written in C99

The program can render several figures with multiple light sources.

Usage

Run make inside the repository's directory to build miniRT binary.

Program needs the path to configuration file as an argument (examples in scenes directory). If flag --save is presented as a second argument, program will make a screenshot and save it in the working directory.

Setting up the configuration file

You can specify what figures to render (plane, sphere, square, cylinder and triangle available), several light sources and points of view.

General scene settings:

  • Window resolution    R  1280  1920
  • Ambient light (brightness, colour)    A  0.6  255,255,255
  • Cameras (coordinates, direction, viewing angle)    c  1.4,0,-1  0,0,1  70
  • Light sources (coordinates, brightness, colour)    l  7,7,4  0.3  255,255,255

Figure's settings:

  • Plane (coordinates, direction, colour)    pl  2,-1.3,0  0,1,0  245,245,245
  • Sphere (coordinates, radius, colour)    sp  3.2,-0.8,-1.4  0.4  60,60,60
  • Square (coordinates, direction, width, colour)    sq  -0.2,0.5,-2.35  1,0,0  0.7  37,245,123
  • Cylinder (coordinates, direction, width, height, colour)    cy  0,0,0  0,1,0  1  2  70,90,225
  • Triangle (coordinates for each angle, colour)    tr  1.5,0.2,2.58  3.2,0.4,3  2.3,2,4.1  255,109,36

About

RayTracer with miniLibX library

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published