Project 06

Abstract Clock

For my clock, I attempted to represent time using the method of burning candles. As we progress into the hour, the candle will become shorter and shorter until the 59th minute is reached. Then, the candle will reset to the original height. The light stripes in the background represent the hour of day on a 24-hour basis.

sketch
// Theresa Ye
// Section E
// thye@andrew.cmu.edu
// Project-06

var x = [16,16,8,12,14,15,16,16,24,28,16,16];
var y = [0,0,-8,-24,-16,-12,-24,-32,-20,-8,0,0];

function setup() {
    createCanvas(400, 400);
    frameRate(7);
}

function draw() {
    background(179,217,217);

    // make background stripes (light stripes = hour)
    strokeWeight(10);
    stroke(102,179,179);
    for (var i = 1; i < hour(); i++) {
        line(0,i*height/hour(),width,i*height/hour());
    }

    translate(width/2 - 16, 400 - 16);

    //make candle :> (candle burning = minutes)
    fill('yellow');
    stroke(0);
    strokeWeight(2);
    rect(6,0,20,-300 + 5*minute()+ 3)
    ellipse(16,-300 + 5*minute() + 3,20,10);

    //make flame :>
    var npoints = x.length;
    fill('pink');
    beginShape();
    for (var i = 0; i < 12; i++) {
        curveVertex(x[i] + random(-3,3),-300 + 5*minute() + y[i] + random(-3,3));
    }
    endShape(CLOSE);
}

Leave a Reply