// Disposable Hexagonal time counting device. PFont font; int x = 1; // 90 segs per minute for seconds int y = 1; // each 10 minutes -- 6 sides. int z = 1; // for hours color cyan = color(116,193,206); color magenta = color(246,31,160); color yellow= color(242,204,47); color black = color (0,0,0); int frame = 0; void setup(){ size (180,200); font = loadFont("Base4.vlw"); textFont(font,6); } // draw clock void draw() { background (0); scale (2.1); translate (3,0); strokeWeight (.3); frameRate (1); //chages animation speed. 1 is default 150 is super fast for preview hexaseconds(); hexaminutes(); hexahours(); String t = nf((z/5400),2) + ":" + nf((y/90),2);// prints the time fill (255); text(t, 33,48); } // specific functions //SLOW CLOCK //seconds void hexaseconds(){ stroke(cyan); print(x); x++; if (x > 15) { line (40,30,50,40); //15 segs } if (x > 15 * 2) { line (50,40,50,50); // : 30 segs } if (x > 15 * 3) { line (50,50,40,60);// : 45 segs } if (x > 15 * 4) { line (40,60,30,50);// :60 segs } if (x > 15 * 5) { line (30,50,30,40);// 75 segs } if (x > 15 * 6) { line (30,40,40,30);// 90 segs } if (x > 91) { x = 0; } } //minutes void hexaminutes(){ stroke(magenta); print(y); y++; if (y > 900) { line (40,30,40,20); // 10 mins \ } if (y > 900 * 2) { line (50,40,60,30); // 20 mins | } if (y > 900 * 3) { line (50,50,60,60); // 30 mins / } if (y > 900 * 4) { line (40,60,40,70);// 40 mins \ } if (y > 900 * 5) { line (30,50,20,60); // 50 mins | } if (y > 900 * 6) { line (30,40,20,30); // 60 mins / } if (y > 5401) { y = 0; } } //hours void hexahours(){ stroke(yellow); print(z); z++; if (z > 5400) { line (40,20,50,10); // 1 } if (z > 5400 * 2) { line (60,30,60,20); // 2 } if (z > 5400 * 3) { line (60,30,70,30); // 3 } if (z > 5400 * 4) { line (60,60,70,60);// 4 } if (z > 5400 * 5) { line (60,60,60,70);// 5 } if (z > 5400 * 6) { line (40,70,50,80);// 6 } if (z > 5400 * 7) { line (40,70,30,80);// 7 } if (z > 5400 * 8) { line (20,60,20,70);// 8 } if (z > 5400 * 9) { line (20,60,10,60);// 9 } if (z > 5400 * 10) { line (20,30,10,30);// 10 } if (z > 5400 * 11) { line (20,30,20,20);// 11 } if (z > 5400 * 12) { line (40,20,30,10);// 12 } if (z > 5400 * 13) { stroke(black); line (40,20,50,10);// 13 } if (z > 5400 * 14) { stroke(black); line (60,30,60,20);// 14 } if (z > 5400 * 15) { stroke(black); line (60,30,70,30);//15 } if (z > 5400 * 16) { stroke(black); line (60,60,70,60);//16 } if (z > 5400 * 17) { stroke(black); line (60,60,60,70);//17 } if (z > 5400 * 18) { stroke(black); line (40,70,50,80);//18 } if (z > 5400 * 19) { stroke(black); line (40,70,30,80);//19 } if (z > 5400 * 20) { stroke(black); line (20,60,20,70);//20 } if (z > 5400 * 21) { stroke(black); line (20,60,10,60);//21 } if (z > 5400 * 22) { stroke(black); line (20,60,10,60);//22 } if (z > 5400 * 23) { stroke(black); line (20,30,20,20);//23 } if (z > 5400 * 24) { stroke(black); line (40,20,30,10);//24 } if (z > 5400 * 24) { z = 0; } } //Manual Controls // void keyPressed(){ if (key == 'n'){ // resets all x = 1; y = 1; z = 1; String t = nf((z/5400),2) + ":" + nf((y/90),2);// prints the time fill (255); text(t, 33,48); } if (key == '1'){ // resets minutes y = 900; String t = nf((z/5400),2) + ":" + nf((y/90),2);// prints the time fill (255); text(t, 33,48); } if (key == '2'){ // resets minutes y = 900*2; String t = nf((z/5400),2) + ":" + nf((y/90),2);// prints the time fill (255); text(t, 33,48); } if (key == '3'){ // resets minutes y = 900*3; String t = nf((z/5400),2) + ":" + nf((y/90),2);// prints the time fill (255); text(t, 33,48); } if (key == '4'){ // resets minutes y = 900*4; String t = nf((z/5400),2) + ":" + nf((y/90),2);// prints the time fill (255); text(t, 33,48); } if (key == '5'){ // resets minutes y = 900*5; String t = nf((z/5400),2) + ":" + nf((y/90),2);// prints the time fill (255); text(t, 33,48); } if (key == '6'){ // resets minutes y = 900*6; String t = nf((z/5400),2) + ":" + nf((y/90),2);// prints the time fill (255); text(t, 33,48); } if (key == 'q'){ // reset hour z = 5400; String t = nf((z/5400),2) + ":" + nf((y/90),2);// prints the time fill (255); text(t, 33,48); } if (key == 'w'){ // reset hour z = 5400*2; String t = nf((z/5400),2) + ":" + nf((y/90),2);// prints the time fill (255); text(t, 33,48); } if (key == 'e'){ // resets hour z = 5400*3; String t = nf((z/5400),2) + ":" + nf((y/90),2);// prints the time fill (255); text(t, 33,48); } if (key == 'r'){ // resets hour z = 5400*4; String t = nf((z/5400),2) + ":" + nf((y/90),2);// prints the time fill (255); text(t, 33,48); } if (key == 't'){ // resets hour z = 5400*5; String t = nf((z/5400),2) + ":" + nf((y/90),2);// prints the time fill (255); text(t, 33,48); } if (key == 'y'){ // resets hour z = 5400*6; String t = nf((z/5400),2) + ":" + nf((y/90),2);// prints the time fill (255); text(t, 33,48); } if (key == 'u'){ // resets hour z = 5400*7; String t = nf((z/5400),2) + ":" + nf((y/90),2);// prints the time fill (255); text(t, 33,48); } if (key == 'i'){ // resets hour z = 5400*8; String t = nf((z/5400),2) + ":" + nf((y/90),2);// prints the time fill (255); text(t, 33,48); } if (key == 'o'){ // resets hour z = 5400*9; String t = nf((z/5400),2) + ":" + nf((y/90),2);// prints the time fill (255); text(t, 33,48); } if (key == 'p'){ // resets hour z = 5400*10; String t = nf((z/5400),2) + ":" + nf((y/90),2);// prints the time fill (255); text(t, 33,48); } if (key == 'a'){ // resets hour z = 5400*11; String t = nf((z/5400),2) + ":" + nf((y/90),2);// prints the time fill (255); text(t, 33,48); } if (key == 's'){ // resets hour z = 5400*12; String t = nf((z/5400),2) + ":" + nf((y/90),2);// prints the time fill (255); text(t, 33,48); } if (key == 'd'){ // resets hour z = 5400*13; String t = nf((z/5400),2) + ":" + nf((y/90),2);// prints the time fill (255); text(t, 33,48); } if (key == 'f'){ // resets hour z = 5400*14; String t = nf((z/5400),2) + ":" + nf((y/90),2);// prints the time fill (255); text(t, 33,48); } if (key == 'g'){ // resets hour z = 5400*15; String t = nf((z/5400),2) + ":" + nf((y/90),2);// prints the time fill (255); text(t, 33,48); } if (key == 'h'){ // resets hour z = 5400*16; String t = nf((z/5400),2) + ":" + nf((y/90),2);// prints the time fill (255); text(t, 33,48); } if (key == 'j'){ // resets hour z = 5400*17; String t = nf((z/5400),2) + ":" + nf((y/90),2);// prints the time fill (255); text(t, 33,48); } if (key == 'k'){ // resets hour z = 5400*18; String t = nf((z/5400),2) + ":" + nf((y/90),2);// prints the time fill (255); text(t, 33,48); } if (key == 'l'){ // resets hour z = 5400*19; String t = nf((z/5400),2) + ":" + nf((y/90),2);// prints the time fill (255); text(t, 33,48); } if (key == 'z'){ // resets hour z = 5400*20; String t = nf((z/5400),2) + ":" + nf((y/90),2);// prints the time fill (255); text(t, 33,48); } if (key == 'x'){ // resets hour z = 5400*21; String t = nf((z/5400),2) + ":" + nf((y/90),2);// prints the time fill (255); text(t, 33,48); } if (key == 'c'){ // resets hour z = 5400*22; String t = nf((z/5400),2) + ":" + nf((y/90),2);// prints the time fill (255); text(t, 33,48); } if (key == 'v'){ // resets hour z = 5400*23; String t = nf((z/5400),2) + ":" + nf((y/90),2);// prints the time fill (255); text(t, 33,48); } if (key == 'b'){ // resets hour z = 5400*24; String t = nf((z/5400),2) + ":" + nf((y/90),2);// prints the time fill (255); text(t, 33,48); } }