xxxxxxxxxx
let t;
let x, y;
let rand;
function setup() {
createCanvas(1200, 800);
noFill();
t = 0;
background(0);
}
function draw() {
x = mouseX / 10000;
y = mouseY / 10000;
for (let i = 0; i <= 2; i++) {
rand = noise(i + t) * 255;
if (i == 0) {
stroke(100 + rand, 100, 100, 20);
} else if (i == 1) {
stroke(100, 100 + rand, 100, 20);
} else if (i == 2) {
stroke(100, 100, 100 + rand, 20);
}
var x1 = width * noise(t + 15 + x +i) ;
var x2 = width * noise(t + 25 + x+i) ;
var x3 = width * noise(t + 35 + x+i) ;
var x4 = width * noise(t + 45 + x+i) ;
var y1 = height * noise(t + 55 + y+i) ;
var y2 = height * noise(t + 65 + y+i) ;
var y3 = height * noise(t + 75 + y+i) ;
var y4 = height * noise(t + 85 + y+i) ;
bezier(x1, y1, x2, y2, x3, y3, x4, y4);
t += 0.001;
}
// clear the background every 500 frames using mod (%) operator
if (frameCount % 500 == 0) {
background(0);
}
}