Re:Writing a Raytracer in Rust – Part 1
by ggambetta on Thursday March 30, 2017 @12:06PM
(#13996585)
With a big emphasis in "small"... for a raytracer you don't need much more than a 3D vector with addition, multiplication, and dot product. For reference, the "linear algebra library" in my tiny raytracer [1] is 6 lines of code (and two are method closing braces): http://gabrielgambetta.com/tiny_raytracer_full.js (functions dot and A_minus_Bk)
That's really cool :) I love me some tiny programs
For where I'm at currently you don't need that much. This is it at the moment https://github.com/k0nserv/rusttracer/blob/master/src/math.r.... I learned about rust macros, operator overloading, traits, derive, tests, the difference between copy and clone in the process. It was a good first step in rust for sure. It's also one of those things that lends them self to TDD very nicely and that cuts down the need to debug anything.
That's the mega tedious part that's no-fun to debug. It's usually where my raytracer projects end haha