float offset;
float[] values;
float offsetNoise;
float valueNoise1, valueNoise2;
void setup(){
size(500, 500);
frameRate(20);
offset = 0;
values = new float[51];
for(int i = 0; i < 51; i++){
values[i] = 0.0;
}
offsetNoise = random(100);
valueNoise1 = random(100);
valueNoise2 = random(100);
stroke(0, 20);
strokeWeight(1);
noFill();
background(255);
}
void draw(){
beginShape();
curveVertex(0, offset + values[0]);
for(int i = 0; i < 51; i++){
curveVertex(i * 10, offset + values[i]);
}
curveVertex(width, offset + values[50]);
endShape();
offset += map(noise(offsetNoise + frameCount * 0.1), 0, 1, 1, 5);
if(offset > height){
offset = 0;
}
for(int i = 0; i < 51; i++){
values[i] += map(noise(valueNoise1 + frameCount * 0.1, valueNoise2 + (i * 10) * 0.04), 0, 1, -1, 1);
}
}