Skip to content

Instantly share code, notes, and snippets.

@shiffman
Created February 11, 2014 18:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save shiffman/8941490 to your computer and use it in GitHub Desktop.
Save shiffman/8941490 to your computer and use it in GitHub Desktop.
// Perlin Noise Blob
// Polar to Cartesian Coordinates
// Daniel Shiffman
// Nature of Code, Spring 2014
float yoff = 0.0;
void setup() {
size(640,360);
}
void draw() {
background(255);
fill(150);
strokeWeight(2);
stroke(0);
beginShape();
float xoff = 0;
for (float a = 0; a < TWO_PI; a += 0.05) {
float r = 100 + map(noise(xoff,yoff),0,1,-20,20);
xoff += 0.3;
float x = r*cos(a);
float y = r*sin(a);
vertex(width/2+x,height/2+y);
}
endShape(CLOSE);
yoff += 0.02;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment