30 Days of Creativity
I am learing Processing for 30daysofcreativity.
Here is my first attempt:
Click and drag the mouse to try it!
You can download a standalong application: Windows | Max OS X | Linux
Source Code:
int angle = 0;
int size = 0;
int inside_stroke = 160;
int outside_stroke = 60;
void setup() {
size(640, 360);
background(102);
smooth();
noStroke();
fill(0, 102);
}
void draw() {
// Draw only when mouse is pressed
if (mousePressed == true) {
angle += 10;
size += 1;
float val = cos(radians(angle)) * 6.0;
for (int a = 0; a < 720; a += 75) {
a = a + (size / 2 );
float xoff = cos(radians(a)) * (val+size);
float yoff = sin(radians(a)) * (val+size);
stroke(outside_stroke);
outside_stroke +=1;
if (outside_stroke > 127) {
outside_stroke = 60;
}
fill(0);
ellipse(mouseX + xoff, mouseY + yoff, val+size, val+size);
if (size > 20) {
size = 1;
}
}
inside_stroke +=1;
if (inside_stroke > 255) {
inside_stroke = 165;
}
stroke(inside_stroke);
fill(255);
ellipse(mouseX, mouseY, 2+size/2, 2+size/2);
} else {
size = 0;
}
}
Inspired by http://processing.org/learning/topics/pulses.html
Welcome
Welcome to the newly designed experimental designexperience.org.