6 comments

[ 3.2 ms ] story [ 19.7 ms ] thread
Neat stuff! I was at a similar point in my career when I wrote my first raytracer. I'd been using povray for years, and used javascript (circa 2003, we didn't even have canvas yet) because it amused me. It took a couple of minutes to render a classic "sphere on checkerboard" scene.

Writing a raytracer is a great exercise for a keen algebra student with decent programming chops. But I'm even happier to see it as a personal project than as homework.

I highly recommend the two books:

Ray Tracing in One Weekend: https://www.amazon.com/dp/B01B5AODD8/

The Ray Tracer Challenge: https://www.amazon.com/dp/1680502719/

For the latter, I have made it a pretty good way through the book, implementing a functional (in the programming paradigm sense) version of the ray tracer in F#. It’s actually rather mind boggling how close the F# code and tests are to the psuedocode found in the book.

https://github.com/bmitc/the-ray-tracer-challenge-fsharp

I think this is a great project to refresh algebra and whatever language you choose to use.

I implemented a ray tracer with Kotlin just to learn the language, and got to use many features and learn them by practice.

Even finding and fixing bugs were fun, as I had to guess where the physics of the light had gone wrong.

I'm getting a bit bored of all the raytracer content on hn. I suppose my problem with it is none of it is especially creative, it's kinda the same maths rendering the same sort of things, except maybe in a different programming style or language.