xxxxxxxxxx
//noprotect
async function setup() {
wis = min(windowWidth,windowHeight);
createCanvas(wis,wis);
noFill();
pixelDensity(2);
background(230);
stroke(190, 80);
strokeWeight(0.15);
let gridSize = 3;
let radius = width / 3;
let centerX = width / 2;
let centerY = height / 2;
for (let x = 0; x <= width; x += gridSize) {
for (let y = 0; y <= height; y += gridSize) {
let dx = x - centerX;
let dy = y - centerY;
if (dx * dx + dy * dy <= radius * radius) {
let nx = map(x, 0, width, 0, 1);
let ny = map(y, 0, height, 0, 1);
let noiseValue = noise(nx, ny);
let angle = map(noiseValue, 0, 1, 0, TWO_PI*2);
let lineLength = gridSize * 20;
let px = x + cos(angle) * lineLength;
let py = y + sin(angle) * lineLength;
line(x, y, px, py);
circle(x, y, px-py);
circle(px, py, x+y);
stroke(30,15);
line(x, y, px, py);
}
}
await sleep(75);
}
}
function draw() {
}
//await sleep(1);
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}