xxxxxxxxxx
34
let t = 0;
function setup() {
createCanvas(400, 400);
frameRate(1);
}
function draw() {
background(0);
fill(255);
noStroke();
circle(60, 60, 40);
fill(116, 207, 140);
perlinPlanina(0.005, 0, 300);
fill(0, 100, 200);
perlinPlanina(0.003, 200, 400);
}
function perlinPlanina(v, min, max) {
beginShape();
for( let i = 0; i <= width; i = i + 1) {
let x = i;
t = t + v;
let y = map(noise(t), 0, 1, min, max);
vertex(i, y);
}
vertex(width, height);
vertex(0, height);
endShape();
}