xxxxxxxxxx
48
let angle = 40;
let amp = 180;
let speed = 0.005;
let inc = 0.8;
function setup() {
createCanvas(400, 400);
pixelDensity(1);
noiseSeed(22);
}
function draw() {
let yoff = 0.05;
loadPixels();
for (let y = 0; y < height; y++) {
let xoff = 3;
for (let x = 0; x < width; x++) {
let index = (x + y * width) * 4;
let alpha = noise(xoff, yoff) *255;
//(0, 128, 254)
pixels[index + 0] = 243-alpha/5;
pixels[index + 1] = 208-alpha/5;
pixels[index + 2] = 150-alpha/5;
pixels[index + 3] = alpha+160;
xoff += inc;
}
yoff += inc;
updatePixels();
}
//waves get closer and closer together
rotate(PI/12);
for (var offset = 8; offset<=height; offset*=2){
wavyLineHorizontal(offset);
}
}
function wavyLineHorizontal(offset) {
stroke(180, 226, 229, 20);
let delay = 0;
for (var x = 0; x<=width+100; x++) {
let y = offset + sin(noise(angle-delay/30))*amp*noise((angle+x)/100);
strokeWeight((y-offset)/7+0.5);
y+=sin(frameCount)*9
point(x,y);
line(x,y,x,height);
delay+=0.5;
}
angle += speed
}