> show canvas only <


/* built with Studio Sketchpad: 
 *   https://sketchpad.cc
 * 
 * observe the evolution of this sketch: 
 *   https://bard117f12.sketchpad.cc/sp/pad/view/ro.lGbFBqymMrN/rev.4
 * 
 * authors: 
 *   kara schultz
 *   dpark

 * license (unless otherwise specified): 
 *   creative commons attribution-share alike 3.0 license.
 *   https://creativecommons.org/licenses/by-sa/3.0/ 
 */ 



/*
* Daniel Park
 * [email protected]
 * 24 October 2012
 */


void setup() {
  size(850, 850);
  smooth();
}


float sc = second();
float mn = minute();
float hr = hour();
  
/*PImage img;
img = loadImage("Space_Deep.jpg");
image(img, 0, 0);
*/


void draw() {
  float s = map(sc + frameCount/60.0, 0, 60.0, 0, TWO_PI) - HALF_PI;
  float m = map(mn + frameCount/3600.0, 0, 60.0, 0, TWO_PI) - HALF_PI;
  float h = map(hr + frameCount/43200.0, 0, 12.0, 0, TWO_PI) - HALF_PI;


  //background(img);

  background(0, 0, 30);
  noStroke();

  pushMatrix();
  translate(width/2, height/2);

  fill(255);
  //line(-, 0, width, height);

  noFill();
  stroke(255);
  // second track
  ellipse(0, 0, 300, 300);

  // minute track
  ellipse(0, 0, 400, 400);

  // hour track
  ellipse(0, 0, 700, 700);
  noStroke();


  // sun
  fill(230, 230, 12);
  ellipse(0, 0, 200, 200);

  // second hand
  fill(200, 12, 12);
  ellipse(cos(s)*150, sin(s)*150, 20, 20);

  // minute hand
  fill(12, 100, 200);
  ellipse(cos(m)*200, sin(m)*200, 30, 30);

  // hour hand
  fill(210, 130, 0);
  ellipse(cos(h)*350, sin(h)*350, 80, 80);


  // minute hand moon (minutes)
  pushMatrix();
  translate(cos(m)*200, sin(m)*200);
  fill(240);
  ellipse(cos(s)*25, sin(s)*25, 10, 10);
  popMatrix();


  // hour hand moon (seconds)
  pushMatrix();
  translate(cos(h)*350, sin(h)*350);
  fill(0, 200, 200);
  ellipse(cos(m)*60, sin(m)*60, 20, 20);
  popMatrix();

  popMatrix();
}