3 ms·
Impressive not only from a "ooo-that's-clever" perspective, but it's also readable, tweakable code. Many of these tiny JS toys aren't things you can really do a
by onion2k 13y ago
Impressive not only from a "ooo-that's-clever" perspective, but it's also readable, tweakable code. Many of these tiny JS toys aren't things you can really do anything with; this example is a great basis for learning.
- ggambetta 13y agoGlad you liked it. It should be far more readable, though; the constraint here was code size in bytes, so even the non-minified code (http://gabrielgambetta.com/tiny_raytracer_full.js http://gabrielgambetta.com/tiny_raytracer_full.js) is quite hacky (especially with the global vars, the horrible "tImageData" hack, the assignments within if conditions, putting all the sphere data in a flat array and playing with the indices,...)