Project -06- Abstract Clock

sketch
let sec = 0; //initial seconds value
let min = 0; // initial minutes value
let hour = 0; // initial hour value
let R = 236; // starting red value for starting color
let G = 84; // starting green value for starting color
let B = 76; // starting blue value for starting color
let fph = 1296000; // frames per 6 hours, for color gradient
let mode = 1; // different colors changing 
let dx = 0; //speed of clouds
let dcar = 0; //speed of car

function setup() {
    background(R, G, B)
    createCanvas(400,400);
    background(220);
    text("p5.js vers 0.9.0 test.", 10, 15);
    frameRate(60);
    count = 0;
}

function draw() {
  count += 1
  background(R, G, B);
  fill(255);
  cloud1();
  cloud2();
  cloud3();
  cloud4();
  dx += 0.5;
  dcar += 0.5;

  //initial rectangle
  fill(0,0,128);
  noStroke();
  rect(50, 380, 100, hour); //hour box, far left
  rect( 150, 380, 100, min); //min bos, middle
  rect (250, 380, 100, sec); //sec box, far right
  
    sec -= 0.1
    if(sec <= -360){
      sec = 0;
      min -= 6;
      if(min <= -360){
        min = 0;
        hour -= 30;
        if(hour <= -360){
          hour = 0;
          
        }
      }
    }
    
    if(count == fph){
      if(mode < 4){
        mode += 1;
      } else {
        mode = 1;
      }
      count = 0;
    }
  //color changing
    if(mode == 1){
      R += 9/fph;
      G += 33/fph;
      B += 60/fph;
    }
  
    if(mode == 2){
      R -= 153/fph;
      G -= 89/fph;
      B -= 84/fph;
    }
    
    if(mode == 3){
      R -= 30/fph;
      G += 19/fph;
      B += 47/fph;
    }
  
    if(mode == 4){
      R += 174/fph;
      G += 37/fph;
      B -= 23/fph;
    }
  
  
  for(i = 350;i > 25; i = i - 25){
    fill(255,255,0);
    if(i > 380+sec){
      rect(260,i,11,15);
      rect(282.5,i, 11, 15);
      rect(305,i,11,15);
      rect(327.5, i, 11, 15);
    }
    
    if(i > 380+min){
      rect(160,i,11,15);
      rect(182.5,i, 11, 15);
      rect(205,i,11,15);
      rect(227.5, i, 11, 15);
    }
    
    if(i > 380+hour){
      rect(60,i,11,15);
      rect(82.5,i, 11, 15);
      rect(105,i,11,15);
      rect(127.5, i, 11, 15);
    }
  }
  car();
  if(dx == 600){
    dx = 0;
  }
}

function cloud1(){
    ellipse(((0 + dx) % 600) - 100,50,50); //first cloud on left
    ellipse(((30 + dx) % 600) - 100,50,50); //first cloud on left
    ellipse(((55 + dx) % 600) - 100,50,50); //first cloud on left
}
function cloud2(){
    ellipse(((275 + dx) % 600) - 100,50,50); //second cloud on the right
    ellipse(((305 + dx) % 600) - 100,50,50); //second cloud on the right
    ellipse(((340 + dx) % 600) - 100,50,50); //second cloud on the right
}
function cloud3(){
    ellipse(((150 + dx) % 600) - 100,150,50); //middle cloud
    ellipse(((185 + dx) % 600) - 100,150,50); //middle cloud
    ellipse(((215 + dx) % 600) - 100,150,50); //middle cloud
}

function cloud4(){
    ellipse(((375 + dx) % 600) - 100, 150, 50);
    ellipse(((410 + dx) % 600) - 100, 150, 50);
    ellipse(((445 + dx) % 600) - 100, 150, 50);
}
function car(){
    fill(255,255,0);
    rect(50 + dcar,365,20,15);
    triangle(70 + dcar,365,70 + dcar,380,80 + dcar,380);
    fill(178,178,255);
    triangle(70 + dcar,365,70 + dcar,375,77 + dcar,375)
    fill(100);
    ellipse(57 + dcar,380,7);
    ellipse(70 + dcar,380,7);
    fill(76.1, 76.1, 100);
    rect(50 + dcar,365,5);
 
    if(dcar > 375){
      dcar = -75
    }
}

The basic idea of this project was to represent time with three buildings each representing seconds, minutes, and hour. Once the building that represents seconds is fully revealed, one increment of the minute building will show up. Once all of the 60 minutes are “filled” up, the hour building will increase by one. For all three buildings to show up, it would take hours, however, the background will slowly change colors from orange to pink, pink to purple, and purple to blue, to distinguish AM and PM. The hour building only represents 12 hours but the background color changing from warm to cool colors will separate the 24 hours into day and night.

my sketch and planning

Project-06-Abstract-Clock

sketch
//Jasmin Kim
//Section D
var x =[];
var y = [];
var dy = [];

function setup(){
  createCanvas(480,480);
  for(var i=0; i<100; i ++){
    x[i] = random(0,width);
    y[i] = random(0,height);
    dy[i] = random(1,4);
    frameRate(10);
  }
}

function draw(){
  background(43,40,41);
  var hr = hour();
  var min = minute();
  var sec = second();
  push();

  fill(0);
  stroke(255);
  text(hr + ':' + min + ':' + sec,width/2-20,20);     //written clock

  rectMode(CORNER);   //snow on the floor (seconds)
  noStroke();
  fill(255);
  rect(0,480,width,-(sec));

  fill(244,234,77);     //moon on the sky (minutes)
  circle(96,81,109);
  fill(43,40,41);
  circle(145+min,81,112);

  if(hr>=19){
    fill(142,98,50);
    rect(404,480, 16, -hr*15);    //tree trunk growing (hours)
    push();
    translate(390,340);           //tree branch 1
    rotate(PI /4);
    rect(0,0,45,18,20);
    pop();
    push();
    translate(404,340);           //tree branch 2
    rotate(-PI /4);
    rect(0,0,45,18,20);
    pop();
    push();
    translate(390,246);           //tree branch 3
    rotate(PI /4);
    rect(0,0,45,18,20);
    pop();
    push();                     //tree branch 4
    translate(404,210);
    rotate(-PI /4);
    rect(0,0,45,18,20);
    pop();

  } else{
    fill(142,98,50);
    rect(404,480, 16, -hr*15);    //tree trunk growing (hours)
    push();
    translate(390,340);           //tree branch 1
    rotate(PI /4);
    rect(0,0,45,18,20);
    pop();
    push();
    translate(404,340);           //tree branch 2
    rotate(-PI /4);
    rect(0,0,45,18,20);
    pop();
    push();
    translate(390,246);           //tree branch 3
    rotate(PI /4);
    rect(0,0,45,18,20);
    pop();
  }
  pop();

  snow();                         //snow fall
  for(var i=0; i<height; i ++){
    snowfall(x[i], y[i], dy[i]);
    y[i] += dy[i];
    if (y[i]> height){
      y[i] =0;
    } else if(y[i]<0){
      y[i]=height;
    }
  }
  push();
  noFill();                       //outline of the canvas
  strokeWeight(2);
  stroke(176,197,226);
  rect(0,0,width,height);
  pop();
}

function snow(){
  var b1;
  var b2;
  b1=color(183,195,206);
  b2=color(205,218,239)
  push();
  noStroke();
  fill(b1);  //3rd snowman body
  circle(245,374,145);
  fill(b2); 
  circle(242,368,149);
  fill(b1);  //2nd snowman body
  circle(245,279,109);
  fill(b2); 
  circle(242, 273,116);
  fill(b1);   //1st snowman body
  circle(243,196,79);
  fill(b2); 
  circle(242,192,82);
  fill(112,119,127);  //snowman eyes
  circle(222,185,11);
  circle(260,185,11);
  fill(222,168,108);  //snowman nose
  triangle(215,200,242,194,242,204);
  fill(182,137,92);
  triangle(215,200,242,202,242,204);

}

function snowfall(x,y,dy){
  fill(255);
  circle(x,y,8);
}

For this project, I tried to draw a season Winter, to my canvas. Depending on the second, the snow gets piled up on the floor as the moon slowly appears referring to the minutes. Trees next to the snowman grows depending on hours.

Project 06 – Abstract Clock

sketch
//Hayoon Choi
//hayoonc
//Section C

var starx = [];
var stary = [];
var starr = [];

function setup() {
    createCanvas(480, 480); //making the stars stay in position 
    for( var i = 0; i <= 300; i++){
      starx[i] = random(width);
      stary[i] = random(height);
      starr[i] = random(3);
    }
}

function draw() {
    background(0);
    //drawing stars in the background
    fill(255, 252, 235);
    noStroke();
    for( var i = 0; i <= 300; i++){
      circle(starx[i], stary[i], starr[i]) 
    }
    flame(240, 240);
    sun(240, 240);
    blush(240, 240);
    eyelash(240, 240);
    eyelash(160, 240);
}

function sun(x, y){
    push();
    translate(x, y);
    noStroke();
    fill(237, 227, 183);
    circle(0, 0, 200); //head
    //eyes
    fill(255);
    stroke(0);
    ellipse(30, -24, 31, 12);
    ellipse(-50, -24, 31, 12);
    fill(0);
    circle(30, -24, 5);
    circle(-50, -24, 5);
    //mouth
    noStroke();
    fill(234, 136, 173);
    arc(-5, -16, 15, 10, PI, 2 * PI);
    arc(-15, -16, 15, 10, PI, 2 * PI);
    arc(-10, -16, 25, 20, 0, PI);
    fill(255);
    circle(-2, -13, 3)
    //mole
    fill(0);
    circle(5, -4, 3)
    pop();
}

function blush(x, y){ //seconds
    let s = second();
    push();
    translate(x, y);
    rotate(radians())
    fill(234, 97, 66);
    noStroke();
    let secondH = map(s, 0, 60, 0, 360);
    arc(30, -5, 30, 20, 0, -secondH);
    arc(-56, -5, 30, 20, 0, -secondH);
    pop();
}

function eyelash(x, y){ //minutes
    //eyelashes grow by minutes
    let m = minute();
    push();
    translate(x, y);
    stroke(0);
    for (var i = 0; i < m; i ++) {
        line(18.5, -29, 18.5, -29 + (-0.5 * i));
        line(30, -31, 30, -31 + (-0.5 * i));
        line(41.5, -29, 41.5, -29 + (-0.5 * i));
    }
    pop();
}

function flame(x, y){ //hours
    //the color of flame changes each hour one by one
    var hournow = hour() % 12 + 1; //restarts after 12 hours
    push();
    translate(x, y);
    //red flame
    scale(2);
      for (var i = 0; i < hournow; i++){
        push();
        fill(221, 54, 54);
        rotate(radians(30 * i - 90));
        noStroke();
        ellipse(50, 0, 45, 25); 
        pop();
    }
    //orange flame
    for (var i = hournow; i < 12; i++){
        push();
        fill(255, 149, 62);
        rotate(radians(30 * i - 90));
        noStroke();
        ellipse(50, 0, 45, 25); 
        pop();
    }
    pop();
} 

I wanted to create a sun in space. The color of each flame changes after one hour, the eyelashes grow taller by minutes, and the blushes fill up by seconds.

Project-06-Abstract Clock

For my abstract clock, I decided to use the concept of a flower garden. The flowers appear once per minute and change color every hour. I also wanted to incorporate day and night in my clock so I made the sky and grass get lighter and darker depending on the hour of the day (ex: from midnight to noon, they get lighter). To incorporate seconds, I added a butterfly that takes 1 minute to move completely across the canvas (flying forward every second).

sketch
var flowerX = []; // flower x positions
var flowerY = []; // flower y positions
var flowerColor = []; // 24 colors (different color per hour)
var grass = []; // stores shade of grass (changes once per hour)
var sky = []; // stores shade of sky (changes once per hour like grass)

// flower r, g, b
var flowerR = 80; 255, 136, 136
var flowerG = 0;
var flowerB = 215;

// grass r, g, b
var grassR = 10; 
var grassG =  90;
var grassB = 30;

// sky r, g, b
var skyR = 25; 
var skyG = 50; 
var skyB = 90;

// butterfly positions
var butterflyX = 0;
var butterflyY = 60;

function setup() {
    createCanvas(480, 400);
    for(var i = 0; i < 24; i ++) { // initialize arrays of elements that change every hour
    	flowerColor[i] = color(flowerR, flowerG, flowerB);
    	grass[i] = color(grassR, grassG, grassB);
    	sky[i] = color(skyR, skyG, skyB);

    	if(i > 12) { // gets darker past noon (day to night)
    		grassR -= 3;
	    	grassG -= 11;
	    	grassB -= 5;
	    	
	    	flowerG += 9;
	    	flowerR -= 10;

	    	skyR -= 10;
	    	skyG -= 12;
	    	skyB -= 14;
    	}
    	else { // gets brighter from midnight (night to day)
    		grassR += 3;
	    	grassG += 11;
	    	grassB += 5;
	    	
	    	flowerB += 10;

	    	skyR += 10;
	    	skyG += 12;
	    	skyB += 14;
    	}
    }
    for(var i = 0; i < 60; i ++) { // once per minute
    	if(i%10 == 0) { // first column of flowers
    		flowerX[i] = 60;
    	}
    	else { // all other columns
    		flowerX[i] = flowerX[i - 1] + width/12;
    	}
    	if(i <= 9) { // first row of flowers
    		flowerY[i] = 2*height/5;
    	}
    	else { // all other rows
    		flowerY[i] = flowerY[i - 10] + width/12;
    	}
    }
}

function drawFlower() {
	// petals
	noStroke();
	var theta = 0;
	var x = 10*cos(radians(theta));
	var y = 10*sin(radians(theta));
	for(var i = 0; i < 8; i ++) {
		rotate(radians(theta));
		ellipse(x, y, 10, 10);
		theta += 45;
	}
	// center
	fill("yellow");
	circle(0, 0, 13);
}

function drawButterfly() {
	fill(255, 192, 204);
	ellipse(0, 0, 20, 20);
	ellipse(0, 20, 20, 20);
	noStroke();
	fill(255, 170, 180);
	ellipse(15, 0, 30, 35);
	ellipse(15, 20, 30, 35);
	stroke(87, 39, 26);
	strokeWeight(4);
	line(-6, 10, 26, 10);
	strokeWeight(2);
	line(26, 10, 36, 5);
	line(26, 10, 36, 15);
}

function draw() {
	noStroke();

	// background changes by hour
	background(sky[hour()]);
	//background(sky[12]);

	// grass changes by hour
	fill(grass[hour()]);
	//fill(grass[12]);
	rect(0, height/3, width, 2*height/3);

	// draw flower once per minute 
	for(var i = 0; i < minute(); i ++) {
		push();
		translate(flowerX[i], flowerY[i]);
		fill(flowerColor[hour()]);
		//fill(flowerColor[12]);
		drawFlower();
		pop();
	}

	// butterfly moves across screen once per minute
	push();
	translate(map(second(), 0, 60, -15, width + 10), butterflyY);
	drawButterfly();
	pop();
}


















sketch on goodnotes

Project 06: Abstract Clock

sketch
var y = 430 //start y position of house
var c = []; //random colors for balloons
var bx = []; //balloon random x coordinate
var by = [];//balloon random y coordinate
var dy = []; // cloud random x coordinate
var dx = []; //cloud random y coordinate
var tx = []; // star random x coordinate
var ty = []; //star random y coordinate

function setup() {
  createCanvas(480, 480);
 //for every minute, randomly colored and located balloon will pop up
 for (i=0; i<= 60; i++){
  c[i] = color(random(255), random(255), random(255))
  bx[i] = random(160, 320)
  by[i] = random((y-30), (y-175))
 }
 //during the daytime, for every hour randomly located cloud will pop up
   for (d = 0; d<=23; d++){
     dx[d] = random(25, width-25)
     dy[d] = random(25, height-25)
   }
 //during nighttime, for every hour randomly located star will pop up
  for (s=0; s<=23; s++){
    tx[s] = random(75, 3*width-25)
    ty[s] = random(75, 3*height-25)
  }  
}
function draw() {
//during nighttime, use dark sky and stars
  if (hour() < 12){      
  background(7, 46, 110);
    star();
  }
 // during daytime, use day sky and clouds
  else {
    background(111, 165, 252)
    cloud();
  }
 //for every second, house will move up four units
translate(0, -4*second()) 
house();   
} 

function house(){ 
  //base house
  noStroke();
  fill(61, 58, 50)
    rect(width/2-28, y-20, 60, 20)
  fill(209, 203, 88)
  noStroke();
    rect(width/2 - 25, y, 25, 50)
  fill(240, 240, 144)
    square(width/2, y, 50)
    triangle(width/2, y, width/2+50, y, width/2 + 25, y-20)
  strokeWeight(10)
  stroke(84, 84, 66)
    line(width/2, y, width/2 +25, y-20)
    line(width/2 +50, y, width/2+25, y-20)
  rect(width/2 + 22, y+25, 5, 15) 
  //for each minute, balloon tied to house will pop up
  for (i=0; i< minute(); i++){
    push();
    //balloon string
    stroke(255)
    strokeWeight(1)
    	line(width/2, y-20, bx[i], by[i])
    //balloons
   	fill(c[i]);
    noStroke()
  		ellipse(bx[i], by[i], 20)
    print(i)
    pop();
  }
}
function cloud(){
//for each hour, cloud will pop up
  for (var d = 0; d<hour(); d++){
  fill(255);
  strokeWeight(3)
    stroke(200)
  ellipse(dx[d], dy[d], 100, 20);
    ellipse(dx[d] + 20, dy[d] - 10, 40, 15)
  }
}

function star(){
//for each hour, star will pop up
  for (var s = 0; s<hour(); s++){
    push();
    stroke(255, 223, 107)
    strokeWeight(3)
    fill(255, 255, 217)
    beginShape();
    scale(0.3)
      vertex(tx[s]+35, ty[s]+3)
      vertex(tx[s] +46, ty[s]+22)
      vertex(tx[s]+68, ty[s]+28)
      vertex(tx[s] + 54, ty[s] +45)
      vertex(tx[s] + 56,ty[s] + 67)
      vertex(tx[s]+35, ty[s]+58)
      vertex(tx[s] + 14, ty[s]+67)
      vertex(tx[s] + 16, ty[s]+45)
      vertex(tx[s]+2, ty[s]+28)
      vertex(tx[s]+24, ty[s]+22)
    endShape(CLOSE);
pop()
  }
}

Over quarantine, I rewatched a bunch of Pixar movies, and was inspired by the movie “Up” for my clock. The house moves upwards for every second, the balloons show the minutes, and the clouds or stars in the background show the hour. In general, I had difficulty making the arrays refresh with the time.

Project-06: Abstract Clock

treeDownload
/// <reference path="../TSDef/p5.global-mode.d.ts" />

var lineLength = 75;
var x = 120;
var y = 240;
var branchAngle = 0;
var strokeGreenColor = 255;
var branchThickness = 10;
var bailout = 10;
var cloudScale=[0.5, 0.75, 1, 1.25, 1.5];
var move;
var b=25;
var h;

function setup() {
    createCanvas(480, 480);
    stroke(0, strokeGreenColor, 0);
    strokeWeight(branchThickness);
}

function draw() {
    //the color of the sky changes depending on what hour it is, if it's before noon, the color turns bluer and after noon it gets darker
    h=hour();
    if (h<12){
        background(51, 15, 20.8*h);
    } else {
        background(51, 15, 255-20.8*(h-12));
    }
    push();
    //the clouds are the minute hand, they move to the left depending on what minute it is
    move = map(minute(), 0, 60, 0, width);
    translate(move, 0)
    drawClouds();
    pop();
    push();
    translate(width / 2, height);
    translate(0, 120-2*second());
    //makes the tree spread out with seconds
    branchAngle = map(second(), 0, 60, 1, 100);
    drawTree(lineLength);
    pop();
}

function drawClouds(){
    //smallest cloud--cloud 1
    push();
    fill(250, 250);
    noStroke();
    scale(cloudScale[0]);
    translate(500,100);
    cloud();
    pop();

    //cloud 2
    push();
    fill(250, 250);
    noStroke();
    scale(cloudScale[1]);
    translate(100, 250);
    cloud();
    pop();

    //cloud 3
    push();
    fill(250, 250);
    noStroke();
    scale(cloudScale[2]);
    translate(400, 350);
    cloud();
    pop();

    //cloud 4
    push();
    fill(250, 250);
    noStroke();
    scale(cloudScale[3]);
    translate(0, 50);
    cloud();
    pop();

    //cloud 5
    push();
    fill(250, 250);
    noStroke();
    scale(cloudScale[4]);
    translate(-50, 250);
    cloud();
    pop();
}

function cloud(){
    ellipse(30, 10, 60, 40);
    ellipse(40, 40, 90, 50);
    ellipse(0, 40, 100, 50);
    ellipse(0, 15, 55, 35);
}

function drawTree(lineLength) {
    //Coloring leaves
    if (lineLength < 15) {
        strokeGreenColor = map(lineLength, 0, 150, 1, 255);
        stroke(0, 150, 0, 150);
        strokeWeight(9);
    }
  //Coloring the branch
    if (lineLength > 15) {
        strokeGreenColor = map(lineLength, 0, 150, 1, 255);
        stroke(139, 69, 19, strokeGreenColor+100);
        branchThickness = map(lineLength, 0, 150, 0, 25);
        strokeWeight(branchThickness);
    }
    if (lineLength >= bailout) {
        line(0, 0, 0, -lineLength * 2);
        translate(0, -lineLength * 2);

        //Right branch 1
        push();
        rotate(radians(branchAngle));
        line(0, 0, 0, -lineLength);
        drawTree(lineLength * 0.65);
        pop();

        //Left branch 1
        push();
        rotate(radians(-branchAngle));
        line(0, 0, 0, -lineLength);
        drawTree(lineLength * 0.65);
        pop();

        //Right branch 2
        push();
        rotate(radians(branchAngle * 0.5));
        line(0, 0, 0, -lineLength);
        drawTree(lineLength * 0.5);
        pop();

        //Left branch 2
        push();
        rotate(radians(-branchAngle * 0.5));
        line(0, 0, 0, -lineLength);
        drawTree(lineLength * 0.7);
        pop();

      }
}

For my project I decided to use a tree, clouds, and the sky as my clock. The tree grows and spreads out with what second it is, and I used the map function to change the angle proportionally to the seconds. The clouds move from left to right based on what minute it is, and at each hour the sky changes color. I wanted to use something organic like a plant to represent my clock but I originally sketched a vine, not a tree.

I decided to use a tree after seeing what someone made on GitHub. I was researching how to make plants that show growth in p5.js and found a tree which uses recursion to add branches. I used the same technique and changed the colors so it looked like how I wanted it to.

Project-06 Abstract Clock

abstract flower clock
function setup() {
    createCanvas(480, 480); 
    background(240, 213, 214);
}

function draw() {
	background(240, 213, 214);
	noStroke();

	push();
	rectMode(CENTER); 
	//dark pink shadow
	fill(208, 186, 187);    
	ellipse(240, 435, 165, 30);

	//plant pot 
	fill(186, 107, 60); 
	rect(240, 405, 75, 65);
	rect(240, 360, 88, 20);
	
	//plant pot shading 
	fill(165, 95, 52);
	rect(240, 372, 75, 4);

	pop();

	//soil filling up represents seconds
	fill(146, 85, 46);
	var s = second();
	rect(205, 435, 70, -s);

	//ombre of pink tracking 10 minute intervals 
	//0 - 10 minute mark
	fill(243, 209, 210);
	rect(0, 245, 480, -20); 
	
	//10 - 20 minute mark
	fill(238, 206, 208);
	rect(0, 225, 480, -20); 
	
	//20 - 30 minute mark
	fill(234, 202, 204);
	rect(0, 205, 480, -20);
	
	//30 - 40 minute mark
	fill(230, 198, 201);
	rect(0, 185, 480, -20);
	
	//40 - 50 minute mark
	fill(224, 194, 196);
	rect(0, 165, 480, -20); 
	
	//50 - 60 minute mark
	fill(220, 190, 195);
	rect(0, 145, 480, -20); 

	//resetting the background past the 60 minute mark
	fill(216, 187, 190);
	rect(0, 125, 480, -150);

	//plant stem growing represents minutes
	fill(30, 71, 42);
	var m = minute();
	rect(237, 350, 5, -50-m*3);

	//plant leaves
	push();
	fill(30, 71, 42);
	translate(224, 320);
	rotate(radians(-60));
	ellipse(0, 0, 18, 43);
	pop();

	push();
	fill(30, 71, 42);
	translate(256, 320);
	rotate(radians(60));
	ellipse(0, 0, 18, 43);
	pop();

	//flower petals represents hours
	var h = hour();
	var hours = map(m, 0, 60, 260, 390);

    if (h < 24 & h > 12){
        h -= 12;
    }
    if (h == 0){
        h = 12;
    }

    for (var i = 0; i < h; i++){
        push();

        translate(240, height - 0.9*hours);
        rotate(radians(30*i));
        //flower petals
        fill(233, 160, 167);
        ellipse(0, 30, 20, 55);
        
        //flower center 
        fill(249, 213, 139);
        ellipse(0, 0, 30, 30);

        pop();
    }
	
}
Initial illustrator sketch
Screenshots of clock at 1:00, 3:30, 9:20, and 12:59

I wanted to create an abstract clock based on a plant growing over time. The pot filling up with soil represents seconds, the plant stem growing represents minutes, and the number of petals represents hours. The ombre of pink rectangles in the background track the minutes based on the position of the yellow center in 10 minute intervals. I had to make a few changes to the design based on where the center landed, which was challenging but once I figured out the map function it was fun to create!

Abstract Clock

For this project I wanted to make a Pokemon clock, I decided to make a clock out of a Pokemons face, Meowth. I wanted to make his face interact as a clock, his coin on the head fills with each additional hour during the day, the eyes are moving with each additional second, and the whiskers grow longer with each additional minute.

sketchDownload
function setup() {
    createCanvas(480, 480);
    background(255);
}
function draw() {
  var s= second();
  var w= width;
  var h=height;
  for(var b=0;b<480;b+=160){
    push();
    noStroke();
    fill(217,184,135);    //background
    rect(b,-1,w/3,h+2);
    fill(72,55,43);
    rect(b-20,-1,20,h+2);
    pop();
  }
  push();
  pop();
  translate(240,245);
  fill(255,0,0);    //pokeball in the background
  arc(0,-15,450,450,PI,0);
  fill(255);
  arc(0,-15,450,450,0,PI);
  push();
  strokeWeight(4);
  line(-225,-15,225,-15);
  pop();
  scale(.75);
  fill(0);    //black part of ears
  triangle(-150,-160,20,-50,-188,0);
  triangle(150,-160,-20,-50,188,0);
  fill(238,187,169);    //pink part of ears
  triangle(-138,-130,0,-50,-168,0);
  triangle(138,-130,0,-50,168,0);
  fill(245,237,198);    //head
  ellipse(0,50,400,300);
  fill(255);
  circle(100,25,125);    //white of eyes
  circle(-100,25,125);
  push();
  fill(240,191,68);    //top and bottom arcs of the coin
  arc(0,-45,80,70,0,PI);
  arc(0,-285,80,70,PI,0,CHORD);
  pop();
  whisker();    //call whiskers
  coin();    //call coin
  eyesl(-130+s,25);    //pupils move with seconds
  eyesr(70+s,25);
  hourcolor();
  push();
  strokeWeight(4);    //mouth
  line(100,125,-100,125);
  arc(100,120,10,10,3/2*PI,.5*PI);
  arc(-100,120,10,10,.5*PI,3/2*PI);
  pop();
  push();
  fill(255);    //teeth
  triangle(-80,127,-60,127,-70,150);
  triangle(80,127,60,127,70,150);
  pop();
}
function whisker(){    //whiskers grow with the minutes
  var m=minute();
  push();
  for(var i=0;i<m;i++){
    noStroke();
    fill(245,237,198+3*i);
    rotate()
    ellipse(210+1.25*i,75,55,10);
    ellipse(-210-1.25*i,75,55,10);
    ellipse(200+1.25*i,90,55,10);
    ellipse(-200-1.25*i,90,55,10);
    ellipse(-80,-70-2*i,10,55);
    ellipse(80,-70-2*i,10,55);
  }
  pop();
}
function coin(){    //rectangles inside of coin
  var h=hour();
  for(var l=0; l<24; l++){
    rect(-40,-55-10*l,80,10);
  }
}
function hourcolor(){    //rectangles go gold with each new hour
  var h=hour();
  for(var l=0; l<=h; l++){
    fill(240,191,68);
    rect(-40,-55-10*l,80,10);
  }
}
function eyesl(x,y){    //left pupil
  fill(0);
  ellipse(x,y,15,90);
}
function eyesr(x,y){    //right pupil
  fill(0);
  ellipse(x,y,15,90);
}
Pokemon 2052 Shiny Meowth Pokedex: Evolution, Moves, Location, Stats

Project-06-Abstract-Clock

clockcyl

function setup() {
    createCanvas(480, 480, WEBGL);
    angleMode(DEGREES);
} 

function draw() {
    background(204,207,235);
    directionalLight(250, 250, 250, 0, 0, -45);
    rotateX(135);
    noStroke();
    //midplane circles
        push();
            rotateX(90);
            ellipse(0,30,100);
            ellipse(160,-40,100);
            ellipse(80,0,100);
            ellipse(-160,-40,100);
            ellipse(-80,0,100);
            stroke(255);
            strokeWeight(1);
            noFill();
            for(let i=0; i<2000;i+=20){
                ellipse(0,30,120+i);
                ellipse(160,-40,120+i);
                ellipse(80,0,120+i);
                ellipse(-160,-40,120+i);
                ellipse(-80,0,120+i);
            }
            noStroke();
        pop();
    //millisecond cylinder
        push();
            translate(160,0,-40);
            fill(255,20);
            cylinder(40, 240);
            fill(40, 106, 167);
            cylinder(40, (millis()%1000)*0.24);
            cylinder(36, ((millis()+75)%1000)*0.24);
            cylinder(32, ((millis()+150)%1000)*0.24);
            cylinder(28, ((millis()+225)%1000)*0.24);
            cylinder(24, ((millis()+300)%1000)*0.24);
        pop();
    //second cylinder
        push();
            translate(80,0);
            fill(255,20);
            cylinder(40, 240);
            fill(40, 159, 167);
            cylinder(40, (second()%60)*4);
            cylinder(36, ((second()+4.5)%60)*4);
            cylinder(32, ((second()+9)%60)*4);
            cylinder(28, ((second()+13.5)%60)*4);
        pop();
    //minute cylinder
        push();
            translate(0,0,30);
            fill(255,20);
            cylinder(40, 240);
            fill(121,94,199);
            cylinder(40, (minute()%60)*4);
            cylinder(36, ((minute()+4.5)%60)*4);
            cylinder(32, ((minute()+9)%60)*4);
        pop();    
    //hour cylinder
        push();
            translate(-80,0);
            fill(255,20);
            cylinder(40, 240);
            fill(94,199,173);
            cylinder(40, (hour()%24)*10);
            cylinder(36, ((hour()+1.8)%24)*10);
        pop();
    //day cylinder
        push();
            translate(-160,0,-40);
            fill(255,20);
            cylinder(40, 240);
            fill(190,94,199);
            cylinder(40, (day()/31)*240);
        pop();
}

I used abstract filling 3D cylinders to represent the passing of time at different scales. From left to right the scales are- Days/Month, Hours/Day, Minutes/Hour, Seconds/Minute, Milliseconds/Second.

I drew out the overall structure and my initial spacing plan for the 3D geometry.

Project 6 – Abstract Clock

For Project 6, I created a rather simple 24 hr clock but displayed abstractly. I purposely duplicated multiple clocks into one composition to create visual intrigue and guide the eye through the mesmerizing movement of the seconds, minutes, and hours. I was inspired by the Apple Watch and its demonstration of time through simplicity and color.

sketch
function setup() {
    createCanvas(400, 400);
    background(220);
    text("p5.js vers 0.9.0 test.", 10, 15);
    angleMode(DEGREES);
}

function draw() {
    background(38, 84, 124);

    //clock transformation
    //total of nine clocks
    push();
    translate(80, 80);
    scale(0.3);
    rotate(-90);
    clock();
    pop();

    push();
    translate(320, 320);
    scale(0.3);
    rotate(-90);
    clock();
    pop();

    push();
    translate(80, 320);
    scale(0.3);
    rotate(-90);
    clock();
    pop();

    push();
    translate(320, 80);
    scale(0.3);
    rotate(-90);
    clock();
    pop();

    push();
    translate(200, 80);
    scale(0.3);
    rotate(-90);
    clock();
    pop();

    push();
    translate(200, 320);
    scale(0.3);
    rotate(-90);
    clock();
    pop();

    push();
    translate(200, 200);
    scale(0.3);
    rotate(-90);
    clock();
    pop();

    push();
    translate(80, 200);
    scale(0.3);
    rotate(-90);
    clock();
    pop();

    push();
    translate(320, 200);
    scale(0.3);
    rotate(-90);
    clock();
    pop();

}

function one() {
    //seconds function
    let s = second();
    strokeCap(SQUARE);
    noFill();
    strokeWeight(50);
    stroke(6, 214, 160);
    //movement
    let secondHand = map(s, 0, 60, 0, 360);
    arc(0, 0, 100, 100, 0, secondHand);
}

function two() {
    //minute function
    let m = minute();
    strokeCap(SQUARE);
    noFill();
    stroke(255, 209, 102);
    //movement
    let minuteHand = map(m, 0, 60, 0, 360);
    arc(0, 0, 200, 200, 0, minuteHand);
}
 function three() {
    //hour function
    let h = hour();
    strokeCap(SQUARE);
    noFill();
    stroke(239, 71, 111);
    //movement
    let hourHand = map(h % 24, 0, 24, 0, 360);
    arc(0, 0, 300, 300, 0, hourHand);

 }

 function clock() {
    //entire clock
    one();
    two();
    three();
    //center of clock
    fill(255);
    noStroke();
    circle(0, 0, 50);
 }

    
    

    



 


Inspiration: