int MAX = 40; float a = 0.0; float b = 0.0; int mode = 0; void setup() { size(800,200); smooth(); background(0,0,255); // colors[i] = color(random(255)); background(color(random(0), random(0), random(255), random(70))); stroke(color(random(255), random(0), random(255), random(70))); framerate(30); } void draw() { fill(0,5); rect(0,0,width,height); float c = a; float d = b; for(int i=0; i<800; i=i+2) { float y = 0; if (mode == 0) { y = sin(c)*mouseX*0.2 + cos(d)*mouseY; } else if (mode == 1) { y = tan(c)*mouseX*0.2;// + cos(d)*mouseY; } // bezier(i, 200, i, i, i, i, 10+y, 10+y); line(i, 100, i, 100+y); c+= 0.2; d+= 0.1; // bezier(i, 200, i, i, i, i, i, i+sin(a)*mouseX*0.2); line(i+6, 150, i, 150+sin(a*4)*mouseX*0.2); a++; } a+= 0.10; b+= 0.10; } void mousePressed() { mode = mode + 1; if (mode == 2) { mode = 0; } }