float sinvalsec, cosvalsec; float angle_sec, angle_min, angle_heu; float sinvalmin, cosvalmin; float sinvalheu, cosvalheu; float rayon_sec = 160.0; float rayon_min = 130.0; float rayon_heu = 100.0; int sec = 0; int minut = 0; int heure = 0; float xsec, ysec, xmin, ymin, xheu, yheu; void setup(){ frameRate(1); size(400, 400); background(0); noStroke(); smooth(); } void draw(){ noStroke(); fill(0,4); rect(0,0,width,height); noFill(); stroke(25); ellipse(width/2, height/2, 320, 320); stroke(50); ellipse(width/2, height/2, 260, 260); stroke(75); ellipse(width/2, height/2, 200, 200); sec = second(); minut = minute(); heure = hour(); //définit les points de la forme // le point des secondes angle_sec = (3 * HALF_PI) + (second()*PI/30); sinvalsec = sin (angle_sec); cosvalsec = cos (angle_sec); xsec = width/2 + (cosvalsec * rayon_sec); ysec = height/2 + (sinvalsec * rayon_sec); // le point des heures angle_heu = (3 * HALF_PI) + (hour()*PI/6); sinvalheu = sin (angle_heu); cosvalheu = cos (angle_heu); xheu = width/2 + (cosvalheu * rayon_heu); yheu = height/2 + (sinvalheu * rayon_heu); // le point des minutes angle_min = (3 * HALF_PI) + (minute() * PI/30); sinvalmin = sin (angle_min); cosvalmin = cos (angle_min); xmin = width/2 + (cosvalmin * rayon_min); ymin = height/2 + (sinvalmin * rayon_min); stroke(255); fill(255, 51); beginShape(); vertex(xsec, ysec); vertex(xheu, yheu); vertex(xmin, ymin); endShape(CLOSE); }