xxxxxxxxxx
21
const lines = [];
const NUM_LINES = 200;
function setup() {
createCanvas(720, 360);
for (let i = 0; i < NUM_LINES; i++) {
lines[i] = random();
let cosPos = map(i, 0, NUM_LINES, 0, TWO_PI);
// lines[i] = abs(cos(cosPos));
}
noLoop();
}
function draw() {
background(255);
for (let i = 0; i < NUM_LINES; i++) {
let xPos = map(i, 0, NUM_LINES, 0, width);
stroke(255*lines[i]);
line(xPos, 0, xPos, height);
}
}