xxxxxxxxxx
37
let w, h;
let nb = 20;
function setup() {
createCanvas(700, 700);
rectMode(CENTER);
w = width/nb;
h = height/nb;
noStroke();
}
function draw() {
background(255);
for(let i = 0; i < nb; i++){
for(let j = 0; j < nb; j++){
let x = w/2 + i*w;
let y = h/2 + j*h;
let noiseScale = 100;
let timestep = frameCount/20;
let n = noise(x/noiseScale,y/noiseScale,timestep);
let col1 = color(100,30,70); // desert
let col2 = color(50,200,140); // jungle
let col3 = lerpColor(col1, col2, n);
fill(col3);
circle(x,y,n*w)
//rect(x,y,w,h);
}
}
}