Skip to content

Instantly share code, notes, and snippets.

@fiskurgit
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fiskurgit/766f315a12d7ee39af5a to your computer and use it in GitHub Desktop.
Save fiskurgit/766f315a12d7ee39af5a to your computer and use it in GitHub Desktop.
Perlin wave processing.org sketch
float noiseScale = 0.018F;
float n = 0.0F;
float speed = 0.4F;
int frameCount = 0;
void setup(){
size(600, 300);
frameRate(30);
}
void draw(){
background(255);
n += speed;
for (int i = 0; i < 60; i++){
for (int j = 0; j < 300; j++){
float f = noise((n + j) * noiseScale, (-n + i) * noiseScale, i * noiseScale);
float grey = map((200.0F - f * 250.0F), 60, 140, 0, 200);
stroke(grey, 120);
pushMatrix();
scale(2,2);
point(j * 2, f * 150);
popMatrix();
}
}
//saveFrame("wave-######.png");
//println("" + (frameCount++));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment