xxxxxxxxxx
28
let zoff = 0.0;
let osn;
let w = 5;
function setup() {
createCanvas(500, 500);
osn = new OpenSimplexNoise(99);
}
function draw() {
let cols = width / w;
let rows = height / w;
let xoff = 0;
for (let i = 0; i < cols; i++) {
let yoff = 0;
for (let j = 0; j < rows; j++) {
noStroke();
let r = osn.noise3D(xoff, yoff, zoff) * 127 + 127;
let g = osn.noise3D(yoff, xoff, zoff) * 127 + 127;
let b = osn.noise3D(zoff, xoff, yoff) * 127 + 127;
fill(r, g, b);
square(i * w, j * w, w);
yoff += 0.1;
}
xoff += 0.01;
}
zoff += 0.01;
}