Skip to content

Instantly share code, notes, and snippets.

@shiffman
Created August 7, 2013 20:08
Show Gist options
  • Save shiffman/6178078 to your computer and use it in GitHub Desktop.
Save shiffman/6178078 to your computer and use it in GitHub Desktop.
void setup() {
size(400,400);
}
void draw() {
float percent = map(mouseX,0,width,0,1);
background(0);
translate(width/2,height/2);
stroke(255);
strokeWeight(2);
noFill();
beginShape();
for (float a = 0; a < TWO_PI; a += 0.1) {
float r1 = map(sin(a*7),-1,1,75,100);
float r2 = map(noise(a),0,1,50,200);
float r = lerp(r1,r2,percent);
float x = r*cos(a);
float y = r*sin(a);
vertex(x,y);
}
endShape(CLOSE);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment