xxxxxxxxxx
65
let angle = 8;
let amp = 100;
let speed = 0.005;
let inc = 0.03;
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] = 60;
pixels[index + 1] = 178;
pixels[index + 2] = 284;
pixels[index + 3] = alpha+160;
xoff += inc;
}
yoff += inc;
updatePixels();
}
//horizontal wavy lines
n= 8 //make each iteration a different wave
for (var offset = 8; offset<=height; offset+=40){
noiseSeed(n);
wavyLineHorizontal(offset);
wavyLineVertical(offset);
n+=1 //changing the seed value for every loop
}
}
function wavyLineHorizontal(offset) {
stroke(150, 246, 249, 100);
let delay = 0;
for (var x = 0; x<=width; x++) {
let y = offset + sin(noise(angle-delay/30))*amp*noise((angle+x)/100);
strokeWeight((y-offset)/7+0.5);
point(x,y);
delay+=0.5;
}
angle += speed
}
//vertical wavy lines
function wavyLineVertical(offset) {
stroke(150, 246, 249, 180);
let delay = 0;
for (var y = 0; y<=width; y++) {
let x = offset + sin(noise(angle-delay/30))*amp*noise((angle+y)/100);
strokeWeight((x-offset)/7);
point(x,y);
delay+=0.5;
}
angle += speed
}