//Sean Meng
//Section B
//hmeng@andrew.cmu.edu
//Project 06
function setup(){
createCanvas(480,480);
angleMode(DEGREES);
}
function draw (){
background(0);
var h = hour();
var m = minute();
var s = second();
stroke(27, 101, 211)
for (var i = 0; i < 100; i += 3)
line(width/5 + i*10, 0, 0, height + i*(-10))
stroke(145, 200, 224)
for (var i = 0; i < 100; i += 2)
line(width/20 + i*10, 0, 0, height + i*(-10))
stroke(27, 101, 211)
for (var i = 0; i < 100; i += 3)
line(width/20 + i*10, height, width, height + i*(-10))
stroke(145, 200, 224)
for (var i = 0; i < 100; i +=2)
line(width/5 + i*10, height, width, height + i*(-10))
push();
noStroke();
fill(20, 27, 226);
translate(width/2,height/2);
rotate(s*(360/60));
rotate(-90);
rect(120, 0, 90, 10);
pop();
push();
noStroke();
fill(125, 114, 224)
translate(width/2,height/2);
rotate(m*(360/60));
rotate(-90);
rect(30, 0, 50, 5);
pop();
push();
noStroke();
fill(171, 45, 206);
translate(width/2,height/2);
rotate(h*(360/12));
rotate(-90);
rect(50, 0, 20, 2);
pop();
noStroke()
fill(211, 107, 196)
ellipse(width/2, height/2, 30, 30)
}
In this project, I wanna combine the previous work with my abstract clock design, the three rectangles represents three hands of the clocks and their colors varies.