xxxxxxxxxx
int cx, cy;
float seconds;
float minutes;
float hours;
PImage img;
void setup() {
size(1000,1000);
stroke(0);
int radius = min(width, height) / 2;
seconds = radius * 0.72;
minutes = radius * 0.60;
hours = radius * 0.50;
cx = width / 2;
cy = height / 2;
img = loadImage("0.png");
}
void draw() {
background(0);
imageMode(CENTER);
image(img,500,500);
float s = map(second(), 0, 60, 0, TWO_PI) - HALF_PI;
float m = map(minute() + norm(second(), 0, 60), 0, 60, 0, TWO_PI) - HALF_PI;
float h = map(hour() + norm(minute(), 0, 60), 0, 24, 0, TWO_PI * 2) - HALF_PI;
stroke(255);
strokeWeight(4);
line(cx, cy, cx + cos(s) * seconds, cy + sin(s) * seconds);
strokeWeight(7);
line(cx, cy, cx + cos(m) * minutes, cy + sin(m) * minutes);
strokeWeight(10);
line(cx, cy, cx + cos(h) * hours, cy + sin(h) * hours);
// Draw the minute ticks
strokeWeight(2);
beginShape(POINTS);
for (int a = 0; a < 360; a+=6) {
float angle = radians(a);
float x = cx + cos(angle) * seconds;
float y = cy + sin(angle) * seconds;
vertex(x, y);
}
endShape();
textSize(60);
textAlign(LEFT,BOTTOM);
fill(0, 150, 153, 70);
text("Time is not real.", 300, 100);
fill(0, 150, 153, 204);
text("Time is not real.", 300, 150);
fill(0, 150, 153);
text("Time is not real.", 300, 200);
}