Skip to content

A ray tracer named after one of the most noble robots out there :)

Notifications You must be signed in to change notification settings

DevinLeamy/WALL-E

Repository files navigation

WALL-E

A ray-tracer named after one of the most noble robots out there :)

sample.py: Two cars surrounded by trees and piles of leaves, in front of a set of large boulders. There's a small and sparkling pond.

Structure

  • /wall-e: The Rust ray-tracing library.
  • /wall-e-py: Rust Python3 bindings, for scripting.
  • /wall-e-py/assets/meshes: Contains .obj mesh files.
  • /wall-e-py-macros: Rust macros used in /wall-e-py.
  • /scripts: Scripts (scenes) you want to render.
  • /images: Images from the scenes requested in the assignment guidelines.
  • SCRIPTING.md: Documentation for the scripting API.

Setup

Note: You will need to have Rust and Python3 installed on your system.

Create a virtual environment and install maturin.

cd wall-e-py
python3 -m venv .env
source .env/bin/activate
pip install maturin
deactivate

Usage

Scripts, which are python3 files, are put in /scripts.

To run a script ./scripts/custom-script.py, from the root folder, call

# No debug output.
./run.sh custom-script
# With debug output.
./debug.sh custom-script

Or, alternatively:

cd wall-e-py
source .env/bin/activate
maturin develop
cd ..
python3 ./scripts/custom-script.py

Rendered images, by default, are placed in the root folder.

Dependencies

  • pyo3: Interacting with Rust code using Python.
  • nalgebra: Linear algebra cratea.
  • image: Image processing crate.
  • lazy_static: Utility crate for creating global mutable variables with non-const initialization.
  • obj: Utility crate for loading obj files.
  • maturin: Building python3 module generated using pyo3.
  • rand: Utility crate for random number generation.

About

A ray tracer named after one of the most noble robots out there :)

Resources

Stars

Watchers

Forks