xxxxxxxxxx
function setup() {
createCanvas(windowWidth, windowHeight);
background(100);
//noLoop();
angleMode(DEGREES);
stroke('white');
strokeWeight(1);
}
function bumpyCircle(centre, approxRadius){
beginShape();
for (let angle = 0; angle < 360; angle += 3) {
let radius = randomGaussian(approxRadius, 4);
let p = p5.Vector.fromAngle(radians(angle), radius);
p.add(centre);
vertex(p.x, p.y);
}
endShape();
}
function mousePosAsVector(){
return createVector(mouseX, mouseY);
}
function draw() {
background(100);
let centre = createVector(width / 2, height / 2);
fill('yellow');
bumpyCircle(centre, 200);
fill('red');
bumpyCircle(mousePosAsVector(), 180);
}