Skip to content

Instantly share code, notes, and snippets.

@Morpholux
Last active September 14, 2019 12:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Morpholux/c0c69f0da0cc51643b84ee1b1765a298 to your computer and use it in GitHub Desktop.
Save Morpholux/c0c69f0da0cc51643b84ee1b1765a298 to your computer and use it in GitHub Desktop.
float [] deltas = new float [8];
void setup() {
size(800, 800);
background(0);
noStroke();
noLoop();
}
void draw() {
background(250,75,30);
curveTightness(0.25);
for (int j = 150; j <= 650; j+= 250) {
for (int k = 100; k <= 700; k+= 150) {
pushMatrix();
translate(j, k);
int ampDelta = 5;
for (int i = 0; i< deltas.length; i++) {
deltas[i] = random(-ampDelta, ampDelta);
}
beginShape();
curveVertex(-90+deltas[0], -50+deltas[1]);
curveVertex(90+deltas[2], -50+deltas[3]);
curveVertex(90+deltas[4], 50+deltas[5]);
curveVertex(-90+deltas[6], 50+deltas[7]);
curveVertex(-90+deltas[0], -50+deltas[1]);
curveVertex(90+deltas[2], -50+deltas[3]);
curveVertex(90+deltas[4], 50+deltas[5]);
endShape(CLOSE);
popMatrix();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment