float a = 0; float a2 = 0; int cx, cy; //float secondsRadius; float c = 100; int s = second(); // Values from 0 - 59 int m = minute(); // Values from 0 - 59 int h = hour(); // Values from 0 - 23 int r = 20; int x = 0; int y = -0; int[] rec = new int [12]; color col = color (100); void setup () { background (0); size (800, 800); smooth (); frameRate (30); } void draw () { translate (width/2, height/2); for (int i = 0; i < 12; i++) { fill (255,0,0); rotate (PI/6); rect (0, -390, 5, 20); fill(255, 5, 7, 120); ellipse (0, -300, 55, 55); fill(0); ellipse (0, -292, 60, 60); } drawminutes (); drawStunden (); drawsecondes (); rotate(radians(a)); translate(100, 0); fill(255,0,0,125); ellipse(0, 0, 40, 40); rotate(radians(-a2)); translate(80, 0); fill(0,255,0,125); ellipse(0, 0, 20, 20); a += 1; a2 += 1.765; } void drawsecondes (){ float s = map(second(), 0, 60, 0, TWO_PI) - HALF_PI; fill (col); ellipse(0 + cos(s) * 200, 0 + sin(s) * 200, 5, 5); if (sin (s) == -1){ col = col + color (random (10,100), random (100,250), random (10,80)); } } void drawminutes (){ int m = minute(); float mw = map(minute(), 0, 60, 0, TWO_PI) - HALF_PI; fill(255,0,0); ellipse (cx + cos(mw) * 260, cy + sin(mw) * 260, 8, 8); ellipse (cx + cos(mw) * 270, cy + sin(mw) * 270, 10, 10); fill(0); ellipse (cx + cos(mw-radians (6)) * 270, cy + sin(mw-radians (6)) * 270, 10, 10); ellipse (cx + cos(mw-radians (6)) * 260, cy + sin(mw-radians (6)) * 260, 8, 8); } void drawStunden () { float mh = map(hour(), 0, 24, 0, 2*TWO_PI) - HALF_PI; fill(0, 255, 0); ellipse (cx + cos (mh)*300, cy+sin(mh)*300, 55, 55); fill(0); ellipse (cx + cos (mh)*290, cy+sin(mh)*290, 60, 60); } void keyPressed () { if (key == 's') { saveFrame ("clock-####.png"); } if (key == CODED) { if (keyCode == ALT) { background (0); } } }