xxxxxxxxxx
38
let spread;
let inc;
let margin = 200;
//noise settings
let offset = 0;
let offsetInc = 0.05
let rowOffset = 60
let lineMultiplier = 80
function setup() {
createCanvas(400, 400);
background(200)
spread = width - margin
inc = TWO_PI / spread;
stroke(255)
fill(0)
}
function draw() {
background(0);
for (let y = 0; y <= 40; y++) {
let a = 0.0;
beginShape();
for (let x = 0; x <= spread; x++) {
let n = noise(offset + x / rowOffset+y) * lineMultiplier
let vert = ((1 - sin(a + PI / 2)) * n)
curveVertex(x + margin / 2, height - vert - (height-y * 5)+150);
a = a + inc;
}
endShape()
}
offset += offsetInc;
}