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:
// Snow boxes - November 2009, Noah Larsen, @earlatron// library for exporting pdf uncomment this line, beginRecord line, and endRecord line to generate pdf on run// import processing.pdf.*;// Setup sketchvoid setup() {// Sets size of sketchsize(640, 480);smooth();//Start recording for pdf - import, beginRecord, endRecord must be uncommented to run//Be sure to change file name each run, otherwise and overwrite will occur//beginRecord(PDF, "sketch_01.pdf");}// Start Drawingvoid draw() {// Sets color of background. Randomizes RGB valuesbackground(random(150, 255), random(0, 75), random(0, 75));//Draws a scattered bunch of white dots all over screen as backdrop.for(int j=1; j<10000; j+=1) {// random starting point for x - these are not global variables and terminate after loop is run.float x_point = random(0, 640);// random starting point for y - these are not global variables and terminate after loop is run.float y_point = random(0, 480);// sets end point variable for xfloat x_end_point = x_point+1;// sets end point variable for yfloat y_end_point = y_point+1;// sets stroke color to whitestroke(255);// Draws a two point linesline(x_point, y_point, x_end_point, y_end_point);// stops animation, creating static image.noLoop();}//draws 19 boxes full of white dotsfor(int j=1; j<20; j+=1) {// random starting point for xfloat x_var = random(0, 640);// random starting point for yfloat y_var = random(0, 480);// random end point for xfloat x_end = x_var+random(30, 300);//random end point for yfloat y_end = y_var+random(30, 300);// start of sub loop, draws 10,000 dots, or one pixel linesfor(int i=1; i<10000; i+=1) {// selects staring point for x based on random set variables abovefloat x_point = random(x_var, x_end);// selects staring point for y based on random set variables abovefloat y_point = random(y_var, y_end);// sets end point variable for xfloat x_end_point = x_point+1;// sets end point variable for yfloat y_end_point = y_point+1;// sets color of stroke to whitestroke(255);// Draws a two point lineline(x_point, y_point, x_end_point, y_end_point);// Stops animation, creating static drawingnoLoop();}}//End recording for pdf - import, beginRecord, endRecord must be uncommented to run//endRecord();}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.
You can get your hands on the most recent version of Processing here.