-
-
Save jshaw/9f69d6b32b2dcb906e09b4d6f8b3924f to your computer and use it in GitHub Desktop.
Arc Clock in Processing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float heleCirkel = TWO_PI; //tau | |
void setup() { | |
size(500,500); | |
background(0); | |
smooth(); | |
} | |
void draw() { | |
background(0); | |
translate(width/2,height/2); | |
rotate(-heleCirkel/4); | |
noFill(); | |
strokeWeight(20); | |
strokeCap(SQUARE); | |
stroke(0, 255, 0); | |
float s = map(second(), 0, 60, 0, heleCirkel); | |
arc(0, 0, 70, 70, 0, s); | |
stroke(255, 0, 0); | |
float m = map(minute(), 0, 60, 0, heleCirkel); | |
arc(0, 0, 120, 120, 0, m); | |
stroke(0, 0, 255); | |
float h = map(hour(), 0, 60, 0, heleCirkel); | |
arc(0, 0, 170, 170, 0, h); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment