xxxxxxxxxx
27
function setup() {
createCanvas(400, 400);
}
let clk = 0, clk2 = 0;;
function draw() {
background(220);
drawCircle(width * 0.5, height * 0.5, 100, 25, clk);
clk += 0.5;
clk2 += noise(clk) * 0.5;
}
function drawCircle(x,y,r,n,clk) {
const step = r/n;
const rsq = r * r;
for(let cx = 0; cx < r; cx += step) {
let cy = sqrt(rsq - cx * cx);
let ny = noise(clk + cx / r * 14 + n) * 50 * (1-cx/(step*n)) +
pow((1 - (abs(mouseX - x - cx) / width)),4) * 25;
stroke(lerpColor(color(100,100,100),color(255,255,0),ny/50));
line(x + cx, y + cy + ny, x + cx, y - cy);
ny = noise(clk -cx / r * 14 + n) * 50* (1-cx/(step*n))
+ pow((1 - (abs(mouseX - x + cx) / width)),4) * 25;
stroke(lerpColor(color(100,100,100),color(255,255,0),ny/50));
line(x - cx, y + cy + ny, x - cx, y - cy);
}
}