Skip to content

oscarlorentzon/ray-tracer

Repository files navigation

Build workflow GitHub license

Ray tracer

Samples

clock sphere3d sphere-scene plane pattern

Prerequisites

  • You have Node installed at v15.8.0+ and Yarn at v1.2.0+
  • You are familiar with Git

Development Workflow

After cloning ray-tracer, run yarn install to fetch its dependencies. Then, you can run several commands:

  • yarn test runs the complete test suite
  • yarn build-src compiles the library
  • yarn build-examples compiles the examples
  • yarn animate <animation-example-name> generates an animation
    • Example: yarn animate spheres
  • yarn generate <highres-example-name> generates a high resolution image
    • Example: yarn generate pattern
  • Render artifacts are written to build/artifacts

Web app

  • yarn build-docs compiles the web app
  • yarn start starts the development server
  • Navigate to http://localhost:8000/docs

Documentation

The ray tracer uses right-handed coordinates and counter-clockwise rotation around the axis. Matrices are row-major.

Image format conversion

To convert the .ppm files to more common image formats, see FORMAT.md.