Skip to content

Instantly share code, notes, and snippets.

@takawo
Created October 18, 2015 02:17
Show Gist options
  • Save takawo/42f1ce3a34d5aab42ce4 to your computer and use it in GitHub Desktop.
Save takawo/42f1ce3a34d5aab42ce4 to your computer and use it in GitHub Desktop.
int rect_size = 150;
void setup() {
size(960, 540);
colorMode(HSB, 360, 100, 100);
smooth();
frameRate(24);
}
void draw() {
fill(0, 0, 0, 80);
rect(0, 0, width, height);
noStroke();
fill(330, 80, 100);
translate(width/2, height/2);
for (int j = -rect_size; j <= rect_size; j += 10) {
for (int i = -rect_size; i <= rect_size; i += 10) {
float distance = sqrt(i*i + j*j);
pushMatrix();
translate(i, j);
rotate((distance / (150* sqrt(2)))* PI * sin(frameCount * 0.01));
ellipse(i, j, noise(frameCount*0.01)*20, noise(frameCount*0.01)*5);
ellipse(i, j, noise(frameCount*0.01)*5, noise(frameCount*0.01)*20);
popMatrix();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment