News for hackers. Stuff that matters.
Re:Writing a Raytracer in Rust – Part 1 by geokon on Thursday March 30, 2017 @11:04AM (#13995983)
"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

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)

[1] http://gabrielgambetta.com/tiny_raytracer.html

Re:Writing a Raytracer in Rust – Part 1 by K0nserv on Thursday March 30, 2017 @12:18PM (#13996687)
That's really cool :) I love me some tiny programs
Re:Writing a Raytracer in Rust – Part 1 by K0nserv on Thursday March 30, 2017 @11:08AM (#13996010)
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.