3 ms·
How can this be achieved with so little code? I was expecting thousands of lines. It's like 100.
by Kiro 12y ago
How can this be achieved with so little code? I was expecting thousands of lines. It's like 100.
- TazeTSchnitzel 12y agoIf you have a look at the scene (with Inspect Element), it's actually pretty simple. It's six walls (each an image), and each of the four sides also has another 5 walls behind it (each also an image) with a statue (image). That, combined with how CSS 3D transforms let you describe 3D graphics in a declarative way (there's an image at some position with some rotation), rather than in an imperative way (bind the buffer, link the shader, do the 3D rendering dance, draw this thing at some position I bound and some rotation I chose, etc.), allows it to be very small. As always, while declarative programming doesn't lead to brilliant performance, it produces much nicer code and it's much easier to write.
- emehrkay 12y agoThe source code is beautiful. Code can be art when you know what you're looking at/looking for, kinda like real art. (I don't like his if/else blocks though)