41 ms·
"Building a small linear algebra library" That's the mega tedious part that's no-fun to debug. It's usually where my raytracer projects end haha
by geokon 10y ago
"Building a small linear algebra library"
That's the mega tedious part that's no-fun to debug. It's usually where my raytracer projects end haha
- K0nserv 10y agoFor 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.rs 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.
- ggambetta 10y agoWith 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 http://gabrielgambetta.com/tiny_raytracer_full.js (functions dot and A_minus_Bk) [1] http://gabrielgambetta.com/tiny_raytracer.html http://gabrielgambetta.com/tiny_raytracer.html
- K0nserv 10y agoThat's really cool :) I love me some tiny programs