xxxxxxxxxx
float t;
int screenDivs = 3;
float x1(float t){
return sin(t/(mouseX/(width/screenDivs)))*200 + sin(t/6)*300;
}
float y1(float t) {
return cos(t/10)*100;
}
int num = random(5, 15);
float x2(float t){
return sin(t/num)*200 + sin(t)*2;
}
float y2(float t) {
return cos(t/(map(mouseY, 0, height, 0, width)/(width/screenDivs)))*200 + cos(t/12)*20;
}
static final int NUM_LINES = 20;
static final int NUM_LINES2 = 20;
void setup(){
size(screenWidth, screenHeight);
colorMode(HSB, width, 1, 1, 1)
}
void draw(){
background(width, 0, 1, 1);
stroke(mouseX, 1, 1, 1);
strokeWeight(5);
translate(width/2, height/2);
stroke(mouseX, 1, 1, 1);
for (int i = 0; i < NUM_LINES; i++){
line(x1(-t+i*2), y1(-t+i*2),x2(-t+i), y2(-t+i));
}
stroke(mouseY, 1, 1, 1);
for (int i = 0; i < NUM_LINES2; i++){
line(x1(t+i), y1(t+i),x2(t+i), y2(t+i));
}
t += 0.2;
}