As I was going through the introductory websites for three.js, I couldn’t help but notice that one thing that’s very common in a “beginner’s demo” was virtual worlds stuffed with a whole bunch of similar geometric primitives. Cool. But none of the demos I saw went beyond demo. They tend to be pretty colourless, pretty motionless, pretty boring.
So I couldn’t help but get something stuck in my head. Oh sure, it’s an ocean of geometric primitives. And sure, I didn’t learn anything about three.js doing this – it’s all the same technojunk as my previous “experiments”. But this is fun. This is art. I got a kick out of making this, the same way I’d get a kick out of lining up and taking a really fun photograph. This, my friends, is nothing but code as art. Really, really basic code, at that. And I think that sadly, art is not something that gets into code nearly often enough…
So, what have we here? What is this? This is nothing but 123 lines of code, running in an iFrame here in my WordPress. Less than 4K. Set it loose in a browser, with no plug-ins, and this is what it does.
There are 222 orbs. Each orb has a moon. Each orb and its moon share a unique colour. They all swirl about the centre, those near the centre swirling more quickly than those on the periphery. The sizes and speeds have all been tweaked, over and over and over, over a few days worth of those moments when I can pull away from both work and family for a moment. It was, in many ways, just like I’d set down to paint a painting over a couple of days worth of free moments. But instead of paint, brushes, and canvas, I used html5, three.js, and a semi-modern browser.