xxxxxxxxxx
float incX = 0.2;
float incY = 0.05;
float distance =8;
float wavesHeight = 350;
bool looping = true;
var frame = 0;
void setup() {
fullScreen();
background(100);
noiseDetail(1);
}
void draw() {
var zOff = looping?frameCount * 0.01:frame* 0.1;
background(0);
noFill();
strokeWeight(1);
stroke(255);
float yOff = 0;
for (int y = -wavesHeight ; y < height+wavesHeight; y+=distance){
float xOff = 0;
beginShape();
for (int x = -wavesHeight; x < width; x +=distance) {
float n = noise(xOff, yOff,zOff);
var value = map(n,0,1,-wavesHeight,wavesHeight);
curveVertex(x, y+value);
xOff+=incX;
}
endShape();
yOff+=incY;
}
}
void MouseClicked() {
looping = !looping;
frame = frameCount;
}