Skip to content

Latest commit

 

History

History
60 lines (47 loc) · 3.25 KB

README.md

File metadata and controls

60 lines (47 loc) · 3.25 KB

Ακτίνα - Ray

Software ray-tracer written in C. Inspired by, The Ray Tracer Challenge by Jamis Buck.

Building

To build run meson setup build, then meson compile -C build. To run the tests, run meson test -C build.

Dependencies

Project Structure

The project roughly follows the structure laid out by the book, deviating where deemed necessary.

Directory Structure

Directory Use
src Source code and header files
test Test source code
subprojects Meson subprojects (dependencies, e.g. Criterion)
LSAN-suppresions.txt Clang LeakSanitizer suppressions file

Modules

Module Files Notes
Tuples tuples.c, tuples.h Chapter 1; Unused, merged into Vectors
Canvas canvas.c, canvas.h Chapter 2
Matrices matrices.c, matrices.h Chapter 3; Unused, merged into Vectors
Vectors vectors.c, vectors.h Chapter 1, 3, 4
Rays rays.c, rays.h Chapter 5, 6, 7, 8, 9; Demo sphere, lighting, camera, shadows, planes

Demos

Sphere - Chapter 5

Source code for this demo is located in test/sphere.c. It shows two spheres in 3D space rendeded by casting rays on a canvas. No shading or light simulation is done, thus the lack of "depth". sphere

Lighting - Chapter 6

Source code for this demo is located in test/lighting.c. It shows a sphere that is lit by a point light. lighting

Camera - Chapter 7

Source code for this demo is located in test/camera.c (dd88842). It shows three spheres surrounded by two "walls" and a "floor". camera

Shadows - Chapter 8

Source code for this demo is located in test/shadows.c. It shows three spheres surrounded by two "walls" and a "floor", illuminated by two light sources. shadows

Planes - Chapter 9

Source code for this demo is located in test/planes.c. It shows three spheres, sitting on a plane, illuminated by three colored lights. planes