Christine Kim – Project-06

sketch

//Christine Kim
//Section A (9:00)
//haewannk@andrew.cmu.edu
//Project-06

function setup() {
    createCanvas(800, 800);
    
    
}

function draw() {
	var H = hour();
	var M = minute();
	var S = second();
    var mappedS = map(S,0,0.5,0,0.5);

    //fill("#D0E1F9");
    noStroke();
    background("#D0E1F9");
    //rect(0,0,width,730);
    fill("#BFDCCF")
    rect(0,730,width,height);

    //stem
    push();
    noFill();
    angleMode(DEGREES);
    stroke("#265C00");
    strokeWeight(8);
    arc(width/2,600,30,400,90,270);
    pop();

    //leaf
    push();
    angleMode(DEGREES);
    noStroke();
    fill("#265C00");
    strokeWeight(4);
    arc(343,700,90,50,0,190);
    arc(343,700,90,40,190,360);
    pop();


    //minutes
    //flower petal rotating every minute
    stroke(255);
    var w = 50;
    var h = 250;
    angleMode(DEGREES);
    push();
    translate(width/2,height/2);
    rotate(M/5*30);
    translate
    fill("#F69454"); //tells minutes
    ellipse(0,-h/2,w,h);
    rotate(45);
    fill("#FFBEBD"); //flower petals
    ellipse(0,-h/2,w,h);
    rotate(45);
    ellipse(0,-h/2,w,h);
    rotate(45);
    ellipse(0,-h/2,w,h);
    rotate(45);
    ellipse(0,-h/2,w,h);
    rotate(45);
    ellipse(0,-h/2,w,h);
    rotate(45);
    ellipse(0,-h/2,w,h);
    rotate(45);
    ellipse(0,-h/2,w,h);
    pop();
    

    //seconds
    //center of the flower increasing in size
    for (var i=0; i<S;i++) {
    	fill("#E4EA8C");
    	ellipse(width/2,height/2,i+mappedS,i+mappedS);
    }
    
    //hours
    //the number of bees increasing each hour
    var beeX = 25;
    var stripeX = 15;
    var eyeL=20;
    var eyeR=30;
    var wing1=25;
    var wing2=25;
    var path1=25;
    var path2=25;
    var path3=25;
    var path4=25;
    
    for (var i=0; i<H; i++) {
    	noStroke();
    	fill("#00CFFA");
    	ellipse(wing1,48,38,9);
    	ellipse(wing2,58,38,9);
        wing1+=33;
        wing2+=33;

    	fill("yellow");
    	noStroke();
    	ellipse(beeX,50,22,40);
        beeX+=33;

    	stroke(0);
    	strokeWeight(3);
    	line(stripeX,50,stripeX+20,50);
    	line(stripeX+1,60,stripeX+18,60);
    	stripeX+=33;

    	ellipse(eyeL,35,1,1);
    	ellipse(eyeR,35,1,1);
    	eyeL+=33;
    	eyeR+=33;

    	strokeWeight(0.5);
    	noFill();
    	arc(path1,100,20,40,90,270);
    	arc(path2,111,19,19,0,90);
    	arc(path3,130,20,55,90,270);
    	arc(path4,112,19,19,270,360);
    	path1+=33;
    	path2+=33; 
    	path3+=33;  
    	path4+=33;  	
    }

//time
textSize(15);
fill("darkblue");
textFont("Comic Sans");

text(nf(H,[],0),80,750);
text(":",100,750);
text(nf(M,[],0),110,750);
text(":",130,750);
text(nf(S,[],0),140,750);


    

    

    
    
}

img_1266

My abstract clock’s hours are shown by the bees, minutes are shown by the pink flower petal, and the seconds are shown by the center of the flower changing in size.

Leave a Reply