xxxxxxxxxx
55
function setup() {
createCanvas(400, 400);
angleMode(DEGREES);
}
function draw() {
background(0);
noFill();
translate(200, 200);
rotate(-90);
let sat = hour();
let minut = minute();
let sekund = second();
let milisekund = frameCount;
let ugaoSekundare = map(sekund, 0, 60, 0, 360);
let ugaoMinutneKazaljke = map(minut, 0, 60, 0, 360);
let ugaoSatneKazaljke = map(sat % 12, 0, 12, 0, 360);
let ugaoMilisekundare = map(milisekund % 60, 0, 60, 0, 360);
push();
rotate(ugaoSatneKazaljke);
stroke("blue");
strokeWeight(26);
line(0, 0, 100, 0);
pop();
push();
rotate(ugaoMinutneKazaljke);
stroke("red");
strokeWeight(18);
line(0, 0, 125, 0);
pop();
push();
rotate(ugaoSekundare);
stroke("yellow");
strokeWeight(10);
line(0, 0, 150, 0);
pop();
push();
rotate(ugaoMilisekundare);
stroke("pink");
strokeWeight(6);
line(0, 0, 180, 0);
pop();
fill(255);
noStroke();
ellipse(0, 0, 26, 26);
}