Skip to content

Instantly share code, notes, and snippets.

@takawo
Last active October 17, 2015 05:25
Show Gist options
  • Save takawo/3ae813c314fa32501dc5 to your computer and use it in GitHub Desktop.
Save takawo/3ae813c314fa32501dc5 to your computer and use it in GitHub Desktop.
ArrayList<PVector> pointList = new ArrayList<PVector>();
float max_radius = 25;
float min_radius = 10;
float padding = 5;
void setup() {
size(960, 540);
smooth();
colorMode(HSB, 360, 100, 100);
}
void draw() {
background(0, 0, 100);
for (int j = 0; j < height; j += max_radius*2 + padding) {
for (int i = 0; i < width; i += max_radius*2 + padding) {
pushMatrix();
translate(i, j);
strokeWeight(0.1);
beginShape();
for (int k = 0; k < 25; k++) {
float r = random(min_radius, max_radius);
float a = random(TWO_PI);
float x = cos(a) * r;
float y = sin(a) * r;
vertex(x, y);
}
endShape(CLOSE);
noLoop();
popMatrix();
}
}
}
void mousePressed() {
redraw();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment