xxxxxxxxxx
30
let cols; let rows; let size = 20;
let colors = [];
let xoff = 0; let yoff = 0; let zoff = 0; let inc = 0.1;
function setup() {
createCanvas(400, 400);
cols = width/size;
rows = height/size;
}
function draw() {
background(220);
noStroke();
xoff = 0;
for (let i=0; i<cols; i++) {
yoff = 0;
for (let j=0; j<rows; j++) {
let c = noise(xoff, yoff, zoff);
if (c > 0.5) {
fill(0);
} else {
fill(255);
}
yoff += inc;
rect(i*size, j*size, size, size);
}
// xoff += inc;
zoff += 0.001;
}
}