/*Paul Greenway
Section 1A
pgreenwa@andrew.cmu.edu
Project-06-Abstract Clock
*/
function setup() {
createCanvas(480, 480);
}
function draw() {
background(255,90,90);
var S = second();
var M = minute();
var H = hour();
var a = (0,0);
var b = (480,480);
var colorS = map(S,0,60,0,255);
stroke(255);
strokeWeight(0.3);
line(0,0,480,480);
strokeWeight(2);
circle(234,234,10,10);
circle(70,70,10,10);
circle(480,480,10,10);
stroke(255);
strokeWeight(0.5);
noFill();
//hour rings
for (i = 0; i < 25; i++) {
circle(480, 480, i*24, i*24);
}
//minute rings
for (i = 0; i < 13; i++) {
circle(234, 234, i*24, i*24);
}
//second rings
circle(70, 70, 200, 200);
//fill circles color style
noStroke();
fill(0,colorS,90,90);
//hour circle
circle(480, 480, H*24, H*24);
//second circle
circle(70, 70, S*3.33, S*3.33);
//minute circle
circle(234, 234, M*4.8, M*4.8);
}
For this project, I wanted to create a clock that used various rings to indicate the time. As time passes, the inner circles begin to fill the 3 different sets of outer rings each representing a different measurement of time. I arranged the sets in a diagonal line so that the viewer is able to see each unit of contribute to the next.