Skip to content

Instantly share code, notes, and snippets.

@coreygo
Created January 20, 2016 02:20
Show Gist options
  • Save coreygo/69e6f3c22974beab9423 to your computer and use it in GitHub Desktop.
Save coreygo/69e6f3c22974beab9423 to your computer and use it in GitHub Desktop.
void setup() {
size(1200,1200,P3D);
smooth(8);
frameRate(60);
hint(DISABLE_OPTIMIZED_STROKE);
colorMode(HSB, 360, 360, 360);
}
void draw() {
background(0);
drawCircles(width/2, height/2, 600);
saveFrame("frames/cir-######.png");
}
void drawCircles(float x, float y, float radius) {
stroke(random(1,359),random(1,359),random(1,359),255);
strokeWeight(1);
noFill();
ellipse(x, y, radius, radius);
// try adjusting radius 2...12
if (radius > 8) {
drawCircles(x + radius/2, y, radius/2);
drawCircles(x - radius/2, y, radius/2);
drawCircles(x, y + radius/2, radius/2);
// uncomment for added fun
//drawCircles(x, y - radius/2, radius/2);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment