4 ms·
https://www.lihaoyi.com/workbench-example-app/raytracer.html https://www.lihaoyi.com/workbench-example-app/raytracer.html is a ray tracer I wrote in a few hours
by lihaoyi 6y ago
https://www.lihaoyi.com/workbench-example-app/raytracer.html https://www.lihaoyi.com/workbench-example-app/raytracer.html is a ray tracer I wrote in a few hours; maybe a single afternoon's worth of time. I already knew my way around 3D vector math from my previous work making toy games in school, but even so it's surprising how short and easy the code is.
It's about ~300 lines of Scala and runs in the browser via Scala.js. The page has a link to the source code. Could definitely be sped up or improved in a myriad of ways, but even as is I think the output graphic is pretty impressive given the input code size and programmer effort!