/* RELOJ base 5 Master en Digial Medial Design, Elisava. Barcelona, 2009 José Vittone */ int posXs, posXm, posXh; int posYs, posYm, posYh; int espacio, tam; //Colores color fondo = color(24, 24, 24); color horas = color(220, 220, 220); color minutos = color(0, 22, 220); color segundos = color(223, 43, 29); void setup(){ espacio = 56; tam = 22; frameRate(1); size(224, 280); smooth(); strokeWeight(2); posYs = posYm = posYh = 0; posXs = posXm = posXh = 1; } void draw(){ background(fondo); dibujaMarcas(); dibujaMinutos(); dibujaHoras(); dibujaSegundos(); } void dibujaHoras() { noStroke(); fill(horas); int h = hour(); if (h > 12) h -= 12; if(h%3 == 0){ posYh = h/3 + 0; } else { posYh = h/3 + 1; } if(h%3 == 0){ posXh = 3; } else if(h%3 ==2){ posXh = 2; } else if(h%3 ==1){ posXh = 1; } for (int x = 1; x<=3; x++) { for (int y = 1; y<=posYh; y++){ if (x > posXh && y == posYh) { // } else { ellipse (espacio*x,espacio*y,tam/2,tam/2); } } } } void dibujaMinutos() { fill(minutos); noStroke(); int m = minute(); int row = m/15; int minEnRow = m - (row * 15); int col = minEnRow / 5; int minEnCirculo = minEnRow - (col * 5); float mAng = map(minEnCirculo, 0, 5, 0 , TWO_PI); fill(0,22,230); arc(espacio*(col+1), espacio*(row+1), tam, tam, 0, mAng); for (int i=0; i