xxxxxxxxxx
var curveCount = 50;
var t = 0;
var inverted = false;
function setup() {
createCanvas(windowWidth, windowHeight);
noFill();
}
function draw() {
background(inverted ? 0 : 255);
for(j = 0; j < curveCount; j++){
var c = 255/curveCount*j;
if(!inverted) c=255-c;
stroke(c);
beginShape();
for(i = 0; i < width; i+=10){
amp = map(noise(i*0.01,(t+j)*0.01)*2-1+sin(i/width*TWO_PI*3)*sin((t+j)/100),-1,1,-200,200);
//amp = map(sin(i/width*TWO_PI)*sin((t+j)/100),-1,1,-200,200);
curveVertex(i,height/2+amp);
}
endShape();
}
t++;
}
function keyPressed(){
if(key=='I'){
inverted = !inverted;
}
}