// Abstract Clock by Jason Begy. Downloaded from http://www.jasonbegy.info/portfolio.html void setup() { size (400,400); frameRate(60); } void draw() { float h = (hour() % 12); float m = minute(); float s1 = second(); float s2 = second(); //sets background color based on minutes/hours background(m*4, s1*4, h*20); //sents marking and quad color based on seconds and hours stroke(h*20, m*4, s1*4); // draws miniute/second marks for (int i = 20; i <= 380; i = i + 6) { for (int j = 390; j <=399; j++){ point (i, j); } } //draws hour marks for (int i = 20; i <= 380; i = i + 30) { for (int j = 383; j <= 389; j++) { point (i, j); } } smooth(); //draws triangle fill(h*20, m*4, s1*4); stroke(h*20, m*4, s1*4); triangle( 20+(s1*6), 100, 20+(m*6), 200, 20+(h*30), 300 ); //draws triangles for second markers fill(s1*4, h*20, m*4); stroke(s1*4, h*20, m*4); triangle ( 15+(s1*6), 90, 25+(s1*6), 90, 20+(s1*6), 100 ); //draws circle for hour marker ellipse ( 20+(h*30), 300, 10, 10 ); //draws quad for minute marker quad( 20+(m*6), 200, 25+(m*6), 205, 20+(m*6), 210, 15+(m*6), 205 ); /* The following code creates a second triangle which moves backwards //draws second triangle fill(h*20, m*4, s1*4); stroke(h*20, m*4, s1*4); triangle( 380-(s1*6), 50, 380-(m*6), 200, 380-(h*30), 350 ); //draws triangles for second markers fill(s1*4, h*20, m*4); stroke(s1*4, h*20, m*4); triangle ( 385-(s1*6), 40, 375-(s1*6), 40, 380-(s1*6), 50 ); //draws circle for hour marker ellipse ( 380-(h*30), 350, 10, 10 ); //draws quad for minute marker quad( 380-(m*6), 200, 385-(m*6), 205, 380-(m*6), 210, 375-(m*6), 205 ); */ }