Project-07: Jaclyn Saik

sketch

/* Jaclyn Saik 
Section E
jsaik@andrew.cmu.edu
Project 07
*/

var maxP = 100; //boundary for points plotted by the curve 
var chang = 1; //variable ised for flipping orientation of fish curve


function setup() {
    createCanvas(480, 480);
    noStroke();   
}

function draw() {
    background("PaleTurquoise");
    textSize(10);
    noStroke();
    fill("LightSeagreen");
    text("click me! yay!", 30, 70);
    text("¡a fish that is math!", 80, 300);
    text("math", 270, 400);
    text("glug....glug", 60, 430);
    text("so interactive!", 350, 30);

    translate(width/2, height/2); //puts axis in center of the canvas 
    if (mouseIsPressed) { //sets if statement that inverses fish curve when mouse is pressed
                chang = -1;
            } else {
                chang = 1;
            }
            print(chang); 
    drawFishie(); //calls fish function 
    drawFishie2();
    drawFishie3(); 
    drawFishie4();
}

function drawFishie() {
        var x; //x value for fish curve parametric equation 
        var y; //y value for fish curve parametric equation 
        var a = constrain(mouseY, 20, 450); //constrains a to value between 20 and 450
        var consT = map(mouseX, 0, width, 1, 5); //maps consT so that mouse X plots a number between 1 and 5
        stroke("peachpuff");
        fill("lightpink");
        
        beginShape();
        for (var i = 0; i < maxP; i++) { //for loop that sets maxiumum points form variable above 
            var t = map(i, 0, maxP, 0, TWO_PI); 

        //fish curve
        //http://mathworld.wolfram.com/FishCurve.html

        x = (a * cos(t)) - ((chang)*((a*(sq(sin(t))))) / 2); //change varibale inverses curve when mouse is pressed
        y = (a* cos(t) * (consT)*sin(t));  //constant manipulates the height of
        // the curve based on mouse x position      
        vertex(x, y);
    }
    endShape(CLOSE);
}

function drawFishie2() { //outline, which is slightly off
        var x; //x value for fish curve parametric equation 
        var y; //y value for fish curve parametric equation 
        var a = constrain(mouseY, 20, 450); //constrains a to value between 20 and 450
        var consT = map(mouseX, 0, width, 1, 10); //maps consT so that mouse X plots a number between 1 and 5
        stroke("tomato");
        strokeWeight(2);
        noFill();
        
        beginShape();
        for (var i = 0; i < maxP; i++) { //for loop that sets maxiumum points form variable above 
            var t = map(i, 0, maxP, 0, TWO_PI); 

        //fish curve
        //http://mathworld.wolfram.com/FishCurve.html

        x = (a * cos(t)) - (.5*(chang)*((a*(sq(sin(t))))) / 2); //change varibale inverses curve when mouse is pressed
        y = (a* cos(t) * (consT)*sin(t));  //constant manipulates the height of
        // the curve based on mouse x position      
        vertex(x, y);
    }
    endShape(CLOSE);
}

function drawFishie3() { //outline, which is slightly off
        var x; //x value for fish curve parametric equation 
        var y; //y value for fish curve parametric equation 
        var a = constrain(mouseY, 20, 400); //constrains a to value between 20 and 450
        var consT = map(mouseX, 0, width, 0, 5); //maps consT so that mouse X plots a number between 1 and 5
        stroke("salmon");
        strokeWeight(8);
        noFill();
        
        beginShape();
        for (var i = 0; i < maxP; i++) { //for loop that sets maxiumum points form variable above 
            var t = map(i, 0, maxP, 0, TWO_PI); 

        //fish curve
        //http://mathworld.wolfram.com/FishCurve.html

        x = (a * cos(t)) - (.5*(chang)*((a*(sq(sin(t))))) / 2); //change varibale inverses curve when mouse is pressed
        y = (a* cos(t) * 7*(consT)*sin(t));  //constant manipulates the height of
        // the curve based on mouse x position      
        vertex(x, y);
    }
    endShape(CLOSE);
}

function drawFishie4() { //outline, which is slightly off
        var x; //x value for fish curve parametric equation 
        var y; //y value for fish curve parametric equation 
        var a = constrain(mouseY, 20, 450); //constrains a to value between 20 and 450
        var consT = map(mouseX, 0, width, 0, 6); //maps consT so that mouse X plots a number between 1 and 5
        stroke("orange");
        strokeWeight(5);
        noFill();
        
        beginShape();
        for (var i = 0; i < maxP; i++) { //for loop that sets maxiumum points form variable above 
            var t = map(i, 0, maxP, 0, TWO_PI); 

        //fish curve
        //http://mathworld.wolfram.com/FishCurve.html

        x = (a * cos(t)) - (.7*(chang)*((a*(sq(sin(t))))) / 2); //change varibale inverses curve when mouse is pressed
        y = (a* cos(t) * 10*(consT)*sin(t));  //constant manipulates the height of
        // the curve based on mouse x position      
        vertex(x, y);
    }
    endShape(CLOSE);
}

Fish Curve!
For this project, I had to experiment a lot with figuring out a way to build a shape that relied on the equations I gave it. I hadn’t really thought about it before, but we have been creating equations for the for loops we’ve been generating these past 2 weeks, so once I wrapped my head around this concept, I was able to understand how to plug these equations in and turn them into code. I originally played around with a cruciform curve (which I forgot to screenshot!), but after figuring out the fish curve, I wasn’t as inspired by it’s shape. The fish curve, by the way, is a curve that is based off an ellipse’s equation, with a pedal point at a specific point of eccentricity e^2 = 1/2. I had fun manipulating the variables on my various curves so that the different fish outlines took on slightly different characteristics, and adding interactions (click on screen!).

 

My first fish I created (after experimenting with a couple other types of curves, which I forgot to document. At first, I wanted to make the fish tiny like an actual fish, but I decided something that grew with the mouse was more exciting.

LO7 Liz Maday

The 9/11 memorial in NYC

Jer Thorpe – 9/11 Memorial

The 9/11 memorial displays about 3,000 names inscribed into bronze panels surrounding two pools of water. The placement of these names may seem to be random, but they are actually specifically arranged according to an algorithm that was created by data artist Jer Thorpe.

The algorithm was built in Processing, and was made to accommodate requests by family members to have names meaningfully placed adjacent to other names, reflecting the relationships and connections between the victims. For example, the investment bank Cantor Fitzgerald was devastated by the attack, losing more than 700 employees and people associated with the company. On the memorial, all these names are listed together, encompassing large portion of the memorial. Even within this section, certain names are placed next to each other to indicate close relationships.

Visualization of the algorithm.

The algorithm works by first putting names into large clusters based on the adjacency requests. Then it figures out where to place these large clusters of names on the memorial, filling in the spaces.

I think this is an amazing example of how a program is able to reflect very human emotions and intentions while also utilizing a precision and complexity that is above human ability.

Jisoo Geum Project – 06

sketch

// Jisoo Geum
// Section B
// jgeum@andrew.cmu.edu 
// Project-06
var prevSec;
var millisRolloverTime;
var sx =[];
var sy =[];
var gx = [];
var gy = [];
var pr = 0;
var pg = 0;

function setup() {
    createCanvas(480, 480);
    millisRolloverTime = 0; 
    angleMode(DEGREES);
}

function draw() {
    background(188,236,235);
    var H = hour();
    var M = minute();
    var S = second();
    
    //shadow 
    noStroke();
    fill(148,219,217);
    ellipse(240,400,350,50);
    

    // top part of the pomegranate 
    var colR = map (H,0,24,82,224);
    var colG = map (H,0,24,193,0);
    fill(colR,colG,86);
    triangle(240,53,260,115,220,115);
    triangle(260,85,270,115,250,115);
    triangle(220,85,230,115,210,115);
    
    //body of the pomegranate 
    strokeWeight(10);
    stroke(colR,colG,86);// outer layer color changes every hour (from green to ) 
    fill(255,242,205); // inner layer color 
    rect(90,120,297,280,120); 
    noStroke();
    fill(165,0,70); // darker part inside the pomegranate  
    rect(111,140,256,241,100);
    fill(255,242,205); 
    rect(222,113,35,23,50); // tip part 
    rect(230,128,20,262); // the line that divides the pomegranate 
    
    // seeds 
    for(var i = 0; i < M; i++){
        // number of seeds change depending on the current minute 
        sx =[212,193,272,214,269,214,269,214,269,214,269,214,269,214,269,212,272,191,293,193,290,290,193,290,193,290,193,290,193,290,192,291,171,312,172,311,172,311,172,311,172,311,172,311,170,313,150,333,150,334,150,334,148,335,151,333,130,353,130,353];
        sy =[166,219,166,194,194,220,220,246,246,298,272,271,298,324,324,350,350,167,167,193,193,219,245,245,270,271,297,297,323,323,349,349,181,181,207,207,233,233,259,259,285,285,311,311,337,337,198,198,230,230,260,260,287,287,318,318,239,239,265,265];
        gx = [210,195,269,213,271,213,270,213,271,213,271,213,271,213,271,210,273,192,297,195,293,293,197,292,195,297,197,297,195,297,196,298,174,319,175,318,175,318,173,318,175,318,174,318,174,310,153,340,154,340,153,340,151,342,154,339,133,360,133,360];
        gy = [162,217,163,193,191,217,217,243,243,295,268,268,295,321,321,347,347,167,167,191,191,216,243,242,267,273,299,299,320,325,351,351,183,183,209,209,235,235,256,261,282,287,308,313,339,339,200,200,232,232,261,261,289,289,320,320,241,241,267,267];
        
        // to make the seeds rotate by seconds 
        push();
        var tilt = (S*(30));
        translate(sx[i], sy[i]);
        rotate(tilt); 
        fill(255, 63, 113);
        ellipse(0,0, 15, 22); 
        pop();

        //the white glow 
        fill(255);
        ellipse (gx[i],gy[i],5,5);
     
    }
}

I decided to use the seeds in a pomegranate to describe minutes and then make them rotate to represent seconds. The color of the pomegranate changes every hour, turning from green to red.

The most challenging part of this assignment was putting all the coordinates for the seed values. I knew that there would be a way to use ratio and for loop to avoid the tedious part, but I could not figure out how to use it with the minute () function.

The reason why I chose to make the colors change from green to red is to show how a pomegranate’s color changes over time as it becomes ripe.

Project 6 Liz Maday

final liz maday 6

var r;
var g;
var b;
var array = [];
var array2 = [];
var array3 = [];

function setup() {
	createCanvas(415, 210);
}
 function draw() {
 	background('lightblue');
 	strokeWeight(1.5);
 	var s = second();
 	var m = minute();
 	var h = hour();

    //lines
    for (var i = 0; i < 7; i += 1) {
    	var space = 60;
    	var x = (i * space) + 20;
    	var y = 0;
    	line(x, y + 50, x, (y + 65));
    	array = ['0s', '10s', '20s', '30s', '40s', '50s', '60s'];
    	array2 = ['0m', '10m', '20m', '30m', '40m', '50m', '60m'];
        textSize(15);
        fill('red');
        text(array[i], x - 10, y + 20);
        fill('green');
        text(array2[i], x - 10, y + 40);
    }
    
    //second boxes
    for (var i = 0; i < s; i += 1) {
    	var x = (i * (space/10)) + 15;
    	var y = 80;

    	fill('red');
    	rect(x, y, 5, 5);

    }

    //minute boxes
    for (var i = 0; i < m; i += 1) {
    	var x = (i * (space/10)) + 15;
    	var y = 90;
    	fill('green');
    	rect(x, y, 5, 15);
    }

    //hour boxes
    for (var i = 0; i < h; i += 1) {
    	var x = (i * 10) + 15;
    	var y = 110;
    	fill('yellow');
    	rect(x, y, 10, 25);

    }

    //hour lines
    for (var i = 0; i < 5; i += 1) {
    	var space = 40;
    	var x = (i * space * 1.5) + 20;
    	var y = 150;
    	line(x, y, x, (y + 15));
    	textSize(15);
    	array3 = ['0hrs', '6hrs', '12hrs', '18hrs', '24hrs'];
    	text(array3[i], x - 10, y + 40);
    	
    }    

 }

I liked how this project made me think about how time can be efficiently displayed in a more simplistic way than a typical clock. My concept for this project had to adjust a few times, as I was still figuring out how to manipulate the time functions.

Romi Jin – Project-05-Abstract Clock

sketch

/*
Romi Jin
Section B
rsjin@andrew.cmu.edu
Project-06
*/

var hr;
var min;
var sec;

var secMap;
var minMap1;
var minMap2;
//var hrMap;

function setup() {
    createCanvas(480, 900);
    background(255, 228, 225);
    angleMode(DEGREES);

    //carrots redraw
    for(var i = 0; i < second(); i++) {
        push();
        carrots(i*(width/60));
        pop();
    }
}

function draw() {

    hr = hour();
    min = minute();
    sec = second();

    secMap = map(sec, 0, 60, 0, width);
    minMap1 = map(min, 0, 60, 50, height-100);
    minMap2 = map(min, 0, 60, 101, height-50);
    //hrMap = map(hr % 12, 0, 12, 0, height);

    push();
    balloons(minMap1);
    pop();
    push();
    bunny(minMap2);
    pop();
    push();
    carrots(secMap);
    pop();
    grass();

    //redraw canvas after one minute so the carrots begin at 0 again
    if (sec==59) {
        background(255,228,225);
        push();
        balloons(50+min+10);
        pop();
        push();
        bunny(101+min+10);
        pop();
        grass();
    }

}

function carrots(xpos) {

    translate(xpos+5, height-13);
    noStroke();

    //left stem 
    push();
    rotate(-20);
    fill(114, 173, 101);
    ellipse(2, -10, 2, 4);
    pop();

    //right stem
    push();
    rotate(20);
    fill(114, 173, 101);
    ellipse(-2, -10, 2, 4);
    pop();

    //middle stem
    fill(114, 173, 101);
    ellipse(0, -10, 3, 6);

    //carrot body
    fill(249, 181, 118);
    ellipse(0, 0, 6, 18);

}

function grass() {

    translate(2, height);
    stroke(203, 232, 189);
    strokeWeight(2);

    //vertical
    var x = 0; //spacing
    for (i = 0; i < width; i++) {
        line(i + x, 0, i + x, -15);
        x += 5; 
    }

    //diagonal
    var x = 0; //spacing
    for (i = 3; i < width; i++) {
        line(i + x, 0, i + x + 3, -15);
        x += 5; 
    }

}

function balloons(ypos) {

    var vals = [240, 220, 210, 265, 235, 255];
    var balloonD = 30;

    //strings
    push();
    stroke(0);
    strokeWeight(0.25);
    line(vals[0], ypos+17.5, width/2, ypos+100);
    line(vals[1], ypos+17.5, width/2, ypos+100);
    line(vals[2], ypos+17.5, width/2, ypos+100);
    line(vals[3], ypos+17.5, width/2, ypos+100);
    line(vals[4], ypos+17.5, width/2, ypos+100);
    line(vals[5], ypos+17.5, width/2, ypos+100);
    pop();

    //balloons
    push();
    noStroke();

    fill(255, 250, 165);
    ellipse(vals[1], ypos+10, balloonD, balloonD+5);
    fill(255, 250, 200);
    ellipse(vals[2], ypos-10, balloonD, balloonD+5);
    fill(190, 240, 235);
    ellipse(vals[3], ypos+10, balloonD-5, balloonD);
    fill(190, 250, 200);
    ellipse(vals[4], ypos-20, balloonD, balloonD+5);
    fill(190, 225, 200);
    ellipse(vals[5], ypos-15, balloonD, balloonD+5);
    fill(255, 221, 165);
    ellipse(vals[0], ypos, balloonD, balloonD+5);
    pop();

}

function bunny(ypos) {

    fill(255);
    stroke(0);
    strokeWeight(0.75);
    //right ear
    push();
    translate(width/2+4, ypos);
    rotate(10);
    ellipse(0, 0, 5, 15);
    pop();
    //left ear
    push();
    translate(width/2-4, ypos);
    rotate(30);
    ellipse(0, 0, 5, 15);
    pop();
    //tail
    ellipse(width/2-15, ypos+41, 8);
    //right foot
    push();
    translate(width/2-10, ypos+49);
    rotate(-45);
    ellipse(18, 15, 8, 12);
    pop();
    //body
    ellipse(width/2, ypos+27, 40, 50);
    //left foot
    push();
    translate(width/2-10, ypos+49);
    rotate(-45);
    arc(3, 4, 8, 12, -10, 260, OPEN);
    pop();
    //left cheek
    push();
    noStroke();
    fill(255, 228, 225);
    ellipse(width/2-7, ypos+19, 6);
    pop();
    //right cheek
    push();
    noStroke();
    fill(255, 228, 225);
    ellipse(width/2+14, ypos+18, 6);
    pop();
    //left eye
    push();
    strokeWeight(3);
    point(width/2-5, ypos+17);
    pop();
    //right eye
    push();
    strokeWeight(3);
    point(width/2+12, ypos+16);
    pop();
    //nose
    line(243, ypos+18, 244, ypos+19);
    line(244, ypos+19, 245, ypos+18);
    //left hand
    push();
    translate(width/2-10, ypos+31);
    rotate(-45);
    arc(3, 4, 6, 8, -10, 250, OPEN);
    pop();
    //right hand
    push();
    translate(width/2-10, ypos+33);
    rotate(-45);
    arc(18, 15, 6, 8, -10, 250, OPEN);
    pop();

}


For my clock, I illustrated a bunny floating down on balloons as time passes. The carrots at the bottom indicate the seconds passed, the bunny moves down as each minute passes, and the bunny resets (goes back to the top) after 12 hours. I wanted to do a lot more with this project (i.e. make the balloons different colors and disappear after each minute went by (it would begin with 60 balloons) and the bunny moving down every hour instead of ever minute), but I ran out of time and was more difficult than I thought it’d be. However, I had so much fun making this project and loved coming up with ideas to make a non-conventional clock! (also, it looks like an iPhone wallpaper I would use!!)

Philip Gates – Project 06 – Abstract Clock

sketch

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

function draw() {
    
    //fetches increments of time
    var H = hour();
    var M = minute();
    var S = second();
    var totalSec = ((H * 3600) + (M * 60) + S); //calculates total # seconds in day so far

    //maps increments of time to circle size
    var mappedH = map(H, 0, 23, 0, 200); 
    var mappedM = map(M, 0, 59, 0, 150); 
    var mappedS = map(S, 0, 59, 0, 100);

    //maps increments of time to color values
    var colorH = map(H, 0, 23, 255, 0); 
    var colorM = map(M, 0, 59, 255, 0); 
    var colorS = map(S, 0, 59, 255, 0); 
    
    //creates grayscale roughly in accordance with time of day
    var sky1 = map(totalSec, 0, 43200, 0, 255); //midnight-noon goes from black to white
    var sky2 = map(totalSec, 43201, 86400, 255, 0); //noon-midnight goes from white to black
    
    background(255);

    //draw background circle, fill according to time of day
    if (totalSec <= 43200) {
        fill(sky1);
    }   else {
        fill(sky2);
    }   ellipse(width/2,height/2,width,height);

    //draw circles that expand as increments of time grow
    //fill with colors that get more saturated as increments of time increase
    noStroke();
    fill(colorH,255,255);
    ellipse(150, 130, mappedH, mappedH); //hour
    fill(255,colorM,255);
    ellipse(260, 270, mappedM, mappedM); //minute
    fill(255,255,colorS);
    ellipse(135, 280, mappedS, mappedS); //second
}

I wanted to keep circles as an integral part of the design, because my own experience of time feels most attuned to cycles— the calendar, circadian rhythms, etc. The movement and color of the inner circles are tied to “human” time (hours, minutes, seconds), while the color of the background circle is tied (very approximately, using noon as the brightest point and midnight as the darkest) to the position of the sun in the sky. The map function came in very handy for this project.

Carley Johnson Abstract Clock

sketch

/*Carley Johnson
Section E
cbjohnso@andrew.cmu.edu
Project-06
*/

function setup() {
  createCanvas(450, 450);
  background(34, 48, 86);
}

function draw() {
  strokeWeight(2);
  translate(width/2, height/2);
  background(34, 48, 86);
  
  var radius = int(min(width, height) / 2);
  var numPoints = 60;
  var angle = TWO_PI/numPoints;
  
  var secondsRadius = radius * 0.72;
  var minutesRadius = radius * 0.60;
  var hoursRadius = radius * 0.50;
  var clockDiameter = radius * 1.8;
  
  var s = map(second(), 0, 60, 0, TWO_PI) - HALF_PI;
  var m = map(minute() + norm(second(), 0, 60), 0, 60, 0, TWO_PI) - HALF_PI;
  var h = map(hour() + norm(minute(), 0, 60), 0, 24, 0, TWO_PI * 2) - HALF_PI;
  
  strokeWeight(2);
  stroke(255);
  beginShape(POINTS);
  var i = 0;
  while (i < numPoints ) {
      x = cos(angle*i) * secondsRadius; 
      y = sin(angle*i) * secondsRadius;
      vertex(x, y);
      i++;
  }
  endShape();  
  
  strokeWeight(2);
  noFill();
  ellipse(0, 0, (cos(m) * minutesRadius) * 2, (sin(m) * minutesRadius) * 2);
  
  stroke(255, 50, 90)
  strokeWeight(5);
  noFill(); 
  ellipse(0, 0, (cos(h) * hoursRadius) * 2, (sin(h) * hoursRadius) * 2);
  
  strokeWeight(1);
  noFill();
  ellipse(0, 0, (cos(s) * secondsRadius) * 2, (sin(s) * secondsRadius) * 2);
}

This was a tough project as the map function and looping (as well as the unused array function) are still a bit new and nebulous to me. Working through it helped, though. Math was never my strong suit, so these projects are getting a lot tougher. This idea came from a nautical theme, from the colors and the circles sort of like a compass (also with the notches on the outer rim). I would’ve liked to make the shapes more complex, but I focused my energy on mapping the time instead.

looking outwards

Jackson Pollock’s art is a main example of art generated by randomness. He was pioneer in abstract art, breaking boundaries of what artists can represent in an image. Pollock lets physics be the main player in his process and he was one of the firsts to make art with the canvas horizontally on the floor, while splattering paint on top. Andy Warhol made fun of this with his Oxidation painting. He had his assistants pee on a canvas that was laying horizontal to the floor. In this he also lets physics be a main player in the making of the work and is a diss to Pollock as pissing on the canvas has this meaning, while he also uses the same creative process to achieve the work.

Austin Treu – Looking Outwards 06

jonathanmccabe.com

Jonathan McCabe’s work is very interesting as he utilizes Alan Turing’s research to create pieces of art from very minuscule levels such as pixels. In these projects, he starts with very small random variations in certain variables of the pixels. Once the project is generated it is filled with a wide variety of different features. His work helps to show that such randomness inherently imitates nature on every scale, particularly on a cellular level. The random projects tend to create shapes and colors that combine to form something reminiscent of nature. This is something that makes the uniqueness of nature seem even more fascinating, as it is all just as random as it may seem from the smallest level up, just like these projects.

Dani Delgado Project 06 – Abstract Clock

sketch

/*Dani Delgado
Section E
ddelgad1@andrew.cmu.edu
Project 06
*/

function setup() {
    createCanvas(480, 375);
    
}

function draw() {
	background(250);

	//set the time variables 
    var h = hour();
    var m = minute();
    var s = second(); 

	//draw the static background / peices 
	//draw the "city"
	//draw the buildings
	noStroke();
	fill(60, 60, 80, 90);
	rect(0, 0, width, height / 2 + 20);

	//draw the building shadows
	noStroke();
	fill(20, 20, 40, 90);
	rect(90, 0, 10, height / 2 + 20, 60, 0, 0, 0);
	rect(350, 0, 10, height / 2 + 20, 0, 60, 0, 0);

	//draw a moving person
	//set the moving variables
	var mapp = map(m, 0, 60, width, 0);
    var personX = mapp;
    var speed = m; 

	//draw the person walking on a minute long loop
    push();
    personX += speed;
	ellipseMode(CORNER);
	noStroke();
	fill(0, 45, 50, 60);
	ellipse(personX, 70, 40, 40);
	rect(personX, 110, 40, 200, 80);
    pop();

	//draw the window 
	fill(230, 247, 255, 40);
	noStroke();
	rect(0, 0, width, height / 2 + 20);

	//draw the window highlights
	stroke(255, 255, 255, 90);
	strokeWeight(50);
	line(300, 0, 480, 200);
	strokeWeight(10);
	line(230, 0, 410, 207);
	strokeWeight(100);
	line(0, 150, 180, 350);

	//draw the window frame shadow
	noStroke();
	fill(80);
	rect(355, 0, 30, height / 2 + 20);
	rect(30, 0, 30, height /2 + 20);

    //window frame
	fill(120);
	rect(355, 0, 25, height / 2 + 17, 0, 0, 50, 0);
	rect(30, 0, 25, height /2 + 17, 0, 0, 50, 0);

	//draw the table
	noStroke();
	fill(157, 115, 70);
	rect(0, height / 2 + 20, width, height);
	fill(137, 95, 50);
	rect(0, 350, width, height);

	//draw the shadow of the mug
	 //make the mug shadow rotate bassed on the hour
    if (h >= 12) {
		h -= 12;
	}
	h = map(h, 0, 11, 0, 360);
	push();
	translate(160, 280);
	rotate(radians(h) - 0.25 * (TWO_PI))
	fill(127, 85, 40, 85);
	rect(0, 0, 100, 80, 60);
	pop();

	//draw the mug
	noStroke();
	fill(204, 255, 212);
	rect(115, 220, 120, 80, 0, 0, 90, 90);
	fill(164, 215, 172);
	ellipse(175, 220, 120, 20);
	fill(77, 51, 0);
	ellipse(175, 225, 100, 10);

	stroke(204, 255, 212);
	strokeWeight(10);
	noFill();
	arc(115, 255, 45, 45, radians(80), radians(300), TWO_PI);

	//draw the steam and make it move 
	//the steam moves up and down with each second 
	//first set the needed variables 
	//and then create an if statement that makes it move up or down every other second
	var steam1Y = 200;
	var steam2Y = 180; 
	if ((s % 2) > 0) {
        steam1Y = 200;
        steam2Y = 180;
	} else if (( s % 2) == 0) {
		steam1Y = 190;
		steam2Y = 170;
	}
	//draw the steam itself 
	//left puff of smoke
	fill(255);
	noStroke();
	ellipse(155, steam1Y + 10, 8, 8);
	ellipse(152, steam1Y + 5, 10, 10);
	ellipse(159, steam1Y - 2, 15, 15);
	ellipse(155, steam1Y - 10, 15, 15);
	ellipse(162, steam1Y - 14, 16, 16);
    //right puff of smoke
	ellipse(195, steam2Y, 10, 10);
	ellipse(200, steam2Y - 6, 12, 12);
	ellipse(198, steam2Y + 5, 8, 8);
	ellipse(197, steam2Y - 10, 15, 15);
    ellipse(202, steam2Y - 14, 18, 18);
    ellipse(198, steam2Y - 20, 12, 12);
	
   
}

This project was a bit challenging for me, especially when coming up with a concept to go with. However, completing the extra credit assignment really helped me to understand the mechanics that goes into making a clock work. I went with a coffee shop idea after looking at how the shadows around my coffee cup collection on my desk change as the day goes on and I thought that it would make a cute clock idea.

There are a few details I wish I could have ironed out but overall I think that this clock is cute and fun.
The steam moves with seconds, the person outside the window moves along with the minutes, and the shadow of the cup rotates with each hour.

An initial sketch of the clock landscape
mug and steam development