Thanks Cargo
Index
Lexus - Fashion Workshop
Lexus – Engineering Amazing
Northern Trust – PLAY for L.A.
Heal the Bay – Buy the Bay
Lexus – December Sales Event
American Express – Bad Hotels
Literati Cafe – Re-design
Bookself
Dead Celebrity Society
Pirate Radio
Processing Sketches
Chain Link Chess
Ad Hoc
——
About Me
CV
Snowflake
the only kind we get in LA
A custom drawing tool for creating snowflakes. Built with Processing. (Fall 2008).

// SNOWFLAKE TOOL
// Click and hold mouse to start drawing.
// The closer you follow the guidelines,
// the more it looks like a snowflake
// Press Enter to clear.



Source Code:

void setup () {
size(400, 400);
strokeWeight(2);
smooth();
size(400,400);
web ();
}

void web () {
stroke(255, 80);
background(151,184, 228);
line (width/2, 0, width/2, height);
line (0, 85, width, 317);
line (315, 0, 85, height);
line (85, 0, 317, height);
line (width, 85, 0, 316);
line (0, height/2, 400, height/2);
}
void draw() {
if(mousePressed == true) {
snow(PI/3);
snow(2 * PI /3);
snow(PI);
snow(4 * PI/3);
snow(5* PI /3);
snow(2 * PI);
}
}


void snow (float ang) {
stroke(255, 200);
strokeWeight(2);
if (mouseButton == LEFT) {
float x = mouseX;
float y = mouseY;
float X = pmouseX;
float Y = pmouseY;
pushMatrix();
translate (200, 200);
rotate(ang);
line(x - 200, y - 200, X - 200, Y - 200);
popMatrix();
}
}

void keyPressed () {
if (key == ENTER) {
web();
}
}


Images:

(2,071 views) Filed under interactive, processing, illustration, drawing tool, web, ucla 
index