Skip to content

Instantly share code, notes, and snippets.

Created October 27, 2013 19:27
Show Gist options
  • Save anonymous/7186832 to your computer and use it in GitHub Desktop.
Save anonymous/7186832 to your computer and use it in GitHub Desktop.
void setup() {
size(500, 500);
noFill();
strokeWeight(3);
strokeJoin(BEVEL);
}
float th1, th2, r, x, y, t;
int N = 16;
void draw() {
background(0);
t = map(frameCount, 0, 48, 0, TWO_PI);
stroke(255);
beginShape();
for (int i=0; i<N; i++) {
th1 = map(i, 0, N, 0, 3*TWO_PI);
th2 = map(i, 0, N, 0, 2*TWO_PI);
r = map(sin(t+th2), -1, 1, 140, 180);
x = width/2 + r*cos(th1);
y = height/2 + r*sin(th1);
vertex(x, y);
}
endShape(CLOSE);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment