Snow

It snowed in Boulder this weekend. As a result, I cranked out some snow-like Processing sketches. In addition, I have been asked about the creation of these sketches, and sketches like these. Therefore, following the sketches is the code that generated them, a download of the pde file, and some further explanation.

The code morphed slightly over the production of all five sketches. Here is the code that generated the last two sketches. I have tried to comment as best as possible:

The above code generates a 2 pixel line, as I found it renders better when opening in Photoshop for saving from pdf to jpeg. You could change out the line for a point if you wanted. This code is pretty processor intensive as it generates somewhere around 200,000 vectors, albeit small ones. The code should be pretty well understandable, but in short, it sets up the sketch, generates a bunch of background dots, then creates 19 boxes of dots that are randomly sized and placed by doing some basic math. If you want to export to pdf, be sure to uncomment the 3 lines that import, start and end the pdf recording function.

Download the pde file here.

You can get your hands on the most recent version of Processing here.

MentalX Archives