xxxxxxxxxx
36
let t;
function setup() {
createCanvas(400, 400);
loadPixels();
let xoff = 0.0;
for (let x = 0; x < width; x++) {
let yoff = 0.0;
for (let y = 0; y < height*2; y++) {
const bright = map(noise(xoff, yoff, t ), 0, 1, 0, 255);
let index = (x + y * width * 2) * 4
pixels[index] = 124;
pixels[index + 1] = bright;
pixels[index + 2] = bright;
pixels[index + 3] = 255;
set(x, y, floor(bright))
yoff += 0.01;
} // for y
xoff += 0.01;
} // for x
updatePixels();
} // setup
function draw() {
t++;
}