Re:Recursive raytracer in 35 lines of JavaScript
by merkitt on Tuesday November 19, 2013 @04:29AM
(#6760108)
I just looked at this childhood drawing of yours: http://www.gabrielgambetta.com/img/1986-listado.jpg
Is that BASIC CODE mixed in with bugs bunny??! Raytracer or no raytracer, this is exceedingly cool.
Re:Recursive raytracer in 35 lines of JavaScript
by ggambetta on Tuesday November 19, 2013 @05:34AM
(#6760310)
Yes, that is (my 5 year old idea of) ZX Spectrum Basic. It follows the format of the listings published in Microhobby (http://microhobby.speccy.cz/mhf/031/MH031_08.jpg - in particular, look at the "NOTAS GRAFICAS" sidebar). I grew up with that :) My programming has improved, my drawing abilities not so much.
Re:Recursive raytracer in 35 lines of JavaScript
by davidpardo on Tuesday November 19, 2013 @05:56AM
(#6760365)
I remember typing that listing, almost thirty years ago. I owe a lot of what my life is now to Microhobby.
I had a really, really ugly trick that saved me a couple of bytes which I removed before posting to HN. I figured out I was using canvas.getImageData() and canvas.putImageData(). So I did this: var tID = "tImageDatA"; canvas["ge"+tID](); canvas["pu"+tID"](); You can see that in the original source: http://gabrielgambetta.com/tiny_raytracer_full.js
Not my proudest hack :D