//Stefanie Suk
//15-104 D
//ssuk@andrew.cmu.edu
//Project - 06 - Abstract Clock
function setup() {
createCanvas(480, 480);
}
function draw() {
background(5, 0, 50); //background color
fill(50); //color of buildings
noStroke();
rect(10, 350, 120, 150);
rect(30, 280, 30, 150);
rect(80, 260, 60, 220);
rect(80, 240, 20, 20);
rect(360, 380, 110, 130);
rect(385, 300, 60, 220);
rect(405, 220, 20, 220); // buildings in background
fill(238, 232, 37);
ellipse(400, 60, 70, 70); //moon
fill(218, 214, 85);
ellipse(300, 50, 5, 5);
ellipse(270, 74, 5, 5);
ellipse(130, 50, 5, 5);
ellipse(20, 80, 5, 5);
ellipse(360, 100, 5, 5);
ellipse(70, 160, 5, 5);
ellipse(230, 140, 5, 5);
ellipse(443, 170, 5, 5); //stars
var H = hour();
var M = minute();
var S = second();
var buildingH = map(H, 23, 0, 280, 0);
var buildingM = map(M, 59, 0, 280, 0);
var buildingS = map(S, 59, 0, 280, 0);
var change = 150/3;
fill(230);
rect(155, 200, change, buildingH);
fill(230);
rect(175+change, 200, change, buildingM);
fill(250);
rect(195+2*change, 200, change, buildingS); //ticking building that represents time, referenced code given in the instructions
}
I thought a lot about how I can represent time without making the clock too literal. I personally think the hardest part about this project was to think of how I can represent my clock than actually creating it. As I was thinking about what to create late at night, I looked outside the window and saw buildings across from my dorm. This struck me hard as I realized how much time I spend working at night. Every time I work at night, I tend to look outside the window once in awhile because I get tired as time passes by. I feel like I’m more aware of ‘time’ during the night than the day, which is why I decided to create a visual of a night cityscape I see outside the window and use the tall buildings as an indicator of time (building is forming as time goes).