xxxxxxxxxx
50
//black & white graphics
let angle = 0;
let r = 300;
function setup() {
createCanvas(windowWidth, windowHeight);
}
function draw() {
let x = mouseX;
let y = mouseY;
let ix = width - mouseX; // Inverse X
let iy = height - mouseY; // Inverse Y
background(0, 10);
fill(255);
ellipse(x, height/2, y, y);
fill(0);
ellipse(ix, height/2, iy, iy);
translate(windowWidth/2, windowHeight/2);
stroke(255);
strokeWeight(3);
noFill();
//let increment = map(mouseX, 0, width, PI, 0.01);
let increment = map(mouseX, 0, width, 0.01, PI);
beginShape();
for (let a = 0; a < TWO_PI; a += increment) {
let r1 = r + random(-30, 10);
let x = r1 * cos(a);
let y = r1 * sin(a);
vertex(x, y);
}
endShape(CLOSE);
}
function mousePressed() {
let fs = fullscreen();
fullscreen(!fs);
}
function windowResized() {
resizeCanvas(windowWidth, windowHeight);
}