xxxxxxxxxx
33
function setup() {
createCanvas(600, 200);
}
function draw() {
background("DodgerBlue");
drawEye (100,90);
drawEye (220,120);
drawEye (520,80);
}
//---------------------------------
function drawEye(ex, ey){
var dy = mouseY - ey;
var dx = mouseX - ex;
var orientation = atan2(dy, dx);
push();
translate(ex, ey);
fill("white");
strokeWeight(5);
stroke("black");
circle(0,0, 100);
rotate(orientation);
fill("darkBlue");
circle(25,0,50);
pop();
}