This repository contains rust code for the book "Ray Tracer Challenge by Jamis Buck".
It is not meant to be an optimised version of the ray tracer. I followed this book to learn the Rust programming language. I have made sure to replicate the various logic and tests presented throughout the book. I may be wrong in some cases and not follow idiomatic code, but, I will try to keep the code well documented and easy to read.
- src/ : contains the code for various data types like tuple, vector, projectile etc and unit tests.
- bin/ : contains end of the chapter exercises
All the unit tests are present in the each of the source code files. You can run all the tests using the command-
cargo test
You have to build each binary in the src/bin directory separately.
cargo run --bin <binary file name without extension>
- Use modules to organise the code
- Use borrowing instead of creating copies to make code efficient
- Optimise the matrix class
- Reduce unnecessary dependencies between structs and move out ray tracing related functions