xxxxxxxxxx
63
let gifLength = 120;
function setup() {
createCanvas(400, 400);
angleMode(DEGREES);
}
function draw() {
background(0);
strokeWeight(8);
noFill();
translate(200, 200);
rotate(-90);
let hr = hour();
let mn = minute();
let sc = second();
// fill(255);
// noStroke();
// textSize(32);
// textAlign(CENTER, CENTER);
// text(hr + " : " + mn + " : " + sc, 200, 200);
let hrAngle = map(hr%12, 0, 12, 0, 360);
let mnAngle = map(mn, 0, 60, 0, 360);
let scAngle = map(sc, 0, 60, 0, 360);
stroke(150, 255, 100);
arc(0, 0, 260, 260, 0, hrAngle);
stroke(150, 100, 255);
arc(0, 0, 280, 280, 0, mnAngle);
stroke(255, 100, 150);
arc(0, 0, 300, 300, 0, scAngle);
push()
rotate(hrAngle);
stroke(150, 255, 100);
line(0,0,60,0);
pop();
push()
rotate(mnAngle);
stroke(150, 100, 255);
line(0,0,80,0);
pop();
push()
rotate(scAngle);
stroke(255, 100, 150);
line(0,0,100,0);
pop();
stroke(255);
point(0,0);
}
function mousePressed() {
saveFrames('out', 'png', 1, 25);
});