Created
August 7, 2013 20:08
-
-
Save shiffman/6178078 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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