Jonathan Liang – Project 6 – Abstract Clock

sketch

//Jonathan Liang
//jliang2
//section A






var ballX = 200;
var ballY = 0;
var speedX = 5;
var count = 0;
var xS = [];
var yS = 0;
var xM = [];
var yM = 0;
var xH = [];
var yH = 0;
var ySpeedS = 10;
var ySpeedM = 5;
var ySpeedH = 3;
var radius = 20;

var action = false;
var dayColor = 255;





function setup() {
    createCanvas(400, 400);
    
 //seconds 
    for (var i = 1; i < 60; i++) {
    	xS[i] = random(20, width - 20);
    	
    }
 //minutes   
    for (var i = 1; i < 60; i++) {
    	xM[i] = random(20, width - 20);
    }
 //hours
 	for (var i = 1; i < 12; i++) {
 		xH[i] = random(20, width - 20);
 	}
}

function draw() {

	frameRate(3);	

//fetching current time
	var H = hour();
    var M = minute();
    var S = second();
    dayColor = map(H, 0, 24, 255, 0);
    H = H % 12;

//background color
	background(dayColor);


//hours
	for (var i = 0; i <= H; i++) {
		noStroke();
		fill(128, 212, 255);
		ellipse(xH[i], yH, radius);
		xH[i] += speedX;
		yH += ySpeedH;
		if (yH > height-20 || yH < 0) {
			ySpeedH = -ySpeedH;
			radius += 10;
		}
		if (xH[i] > height-20 || xH[i] < 0) {
			speedX = -speedX;
			radius += 10;
		}
		

		
	}

//minutes
	for (var i = 0; i <= M; i++) {
		noStroke();
		fill('yellow');
		ellipse(xM[i], yM, 15, 15);
		xM[i] += speedX;
		yM += ySpeedM;
		if (yM > height-20 || yM < 0) {
			ySpeedM = -ySpeedM;
		}
		if (xM[i] > height-20 || xM[i] < 0) {
			speedX = -speedX;
		}
		
	}

//seconds
	for (var i = 0; i <= S; i++) {
		noStroke();
		fill('orange');
		ellipse(xS[i], yS, 10, 10);
		xM[i] += speedX;
		yS += ySpeedS;
		if (yS > height-20 || yS < 0) {
			ySpeedS = -ySpeedS;
		}
		if (xS[i] > height-20 || xS[i] < 0) {
			speedX = -speedX;
		}
		
	}








}

Uh for this project, I start with, with a concept, of the world. The world is so hectic and fast moving that we have trouble keeping track of time. The minutes and seconds represent the stars in the sky and the gradually expanding blue circles (hours) represent the tide of the ocean. The minutes and the seconds move so fast, which is symbolic of how life moves so quickly, that we don’t have time to look at the stars in the sky. This whole paragraph sounds incredibly corny and I’m so sorry that it does.

Justin Yook – Looking Outwards 06

Isohedral III

Isohedral III by Tyler Hobbs is one of his many algorithmic computational art that uses the concept of randomness. In contrast to his other art, I think Isohedral III is most interesting because it is clear on how he uses randomness of shapes, patterns, and colors. For example, one can see how all the shapes such as spirals, circles, and radial lines have repetitions, but when they are put together in random ways, they create random tile shapes throughout. Unfortunately, Hobbs does not share his source code to the public. His artistic sensibilities are shown from his color arrangement; the way the overall color scheme changes from blue, to red, to green is eye popping, and complement each other very well.

Source: http://www.tylerlhobbs.com/

Eunice Choe – Looking Outwards -06

The canvas randomizes after every click.

The lines are random – some are curly and some are straight.

Matt Deslauriers, a creative developer created a generative art project (2016) that shows randomly drawn lines on a composition. In addition, clicking the canvas randomizes the composition into a new random set of lines and colors. I admire this piece because the different textured lines and splotches are visually pleasing without being too overwhelming. I also like the idea of entering a new experience with every click because of the randomized shapes and color combinations. Matt Deslauriers used Node.js to create the piece because it is reliable when working with large resolutions. Deslauriers also took inspiration from the strokes of impressionist paintings but accumulating the lines instead of constantly clearing the canvas. Simplex noise is used to make the particles move, as they are given random positions. In addition, the noise that controls the lines’ movement is randomized, which causes some lines to curl up and others to run straight. Deslauriers’ artistic sensibilities manifest in the piece through the impressionist influence and the randomized color palettes. Deslauriers based the color palettes off of popular and visually pleasing color combinations and ended up using 200 palettes in the final form.

Jason zhu-Project-06-Abstract Clock

sketch

/* Jason Zhu
jlzhu@andrew.cmu.edu
Section E
Project Abstract Clock
*/

var prevSec;
var millisRolloverTime;

function setup() {
    createCanvas(400, 355);
    background(8, 7, 17);
    millisRolloverTime = 0;
}

function draw() {
    noStroke();
    // Fetch the current time
    var H = hour();
    var M = minute();
    var S = second();
    var MS = millis();

    // predetermined function
    if (prevSec != S) {
        millisRolloverTime = millis();
    }
    prevSec = S;
    var mils = floor(millis() - millisRolloverTime);

    // display hour bar
    if (H==0){
        fill(8, 7, 17);
        rect(30,0,60,360);
    } else {
        for(i=0;i<H;i++){
            var r = (i*(255/23));
            var g = (0);
            var b = (0);
            fill(r,g,b);
            rect(30,(i*(300/23)),60,60);
        }
    }

    // display minute bar
    if (M==0){
        fill(8, 7, 17);
        rect(130,0,60,360);
    } else {
        for(i=0;i<M;i++){
            var r = (0);
            var g = (i*(255/59));
            var b = (0);
            fill(r,g,b);
            rect(130,i*(300/59),60,60);
        }
    }

    // display second bar
    if (S==0){
        fill(8, 7, 17);
        rect(230,0,60,360);
    } else {
        for(i=0;i<S;i++){
            var r = (0);
            var g = (0);
            var b = (i*(255/59));
            fill(r,g,b);
            rect(230,i*(300/59),60,60);
        }
    }

    // display milli/second bar
    if (S==1 || S ==3 || S==5 || S ==7 || S==9 || S ==11 || S==13 || S ==15 || S==17 || S ==19 || S==21 || S ==23 || S==25 || S ==27 || S==29 || S ==31 || S==33 || S ==35 || S==37 || S ==39 || S==41 || S ==43 || S==45 || S ==47 || S==49 || S ==51 || S==53 || S ==55 || S==57 || S ==59){
        fill(8, 7, 17);
        rect(330,0,60,360);
    } else {
            fill(255);
            rect(330,0,60,360);
        }
    
}

For this project I hoped to visualize clocks in a linear and color way. I wanted to represent the individual component of my clock with different R,G,B values. By using color, in addition to slight position cues, the goal was to create another more abstract method of keeping track of the time of the day. I developed the idea by trying to think of other ways that people visualized things. Naturally, color was something that was at the precipice of my mind. Overall, I think I learned a good amount about pulling various information from the world into my code. I imagine additional applications to be things such as pulling weather data or humidity data.

Jason Zhu-LookingOutwards-06


This is an image of Tyler Hobbs work, Community 5, created with various algorithms.

http://www.tylerlhobbs.com/writings/probability-distributions-for-artists. Created in 2014 by Tyler Hobbs.

Community 5 is an artwork derived from various algorithmic work. In this case, the artist, Tyler Hobbs, used pseudo-Pareto distribution to vary the length of width of polygons used in the piece. He does this quite successfully in my opinion as it neither seems overly generated or overly humanistic; achieving the right balance of algorithmic work and human effort. The Pareto distribution is a form of power law distribution and is useful in situations where one wants to create balanced objects of various sizes. Other applications of the Pareto distribution include in Hobbs words “the population of cities (many small cities, few very large cities) and the wealth of individuals (many poor indiviuals, few very rich).”

Sarah Yae Looking Outwards 6 Section B

‘Pier and Ocean’ by Kenneth Martin

‘Pier and Ocean’ by Kenneth Martin was created in 1980. I found this artwork interesting because the lines, although randomly placed, created an artwork with meaning.  Although the lines have a color sequence that is patterned and similar, the placements of the line are random — parallel and intersecting. The artist, Kenneth Martin, was inspired to produce this artwork by an era, called Constructivism. This era focused on abstract art and randomness; his focus in this period of time allowed to create this artwork ‘Pier and Ocean,’ which incorporates abstract placement of the lines and randomness.

More information on the artwork could be found on:

https://www.tate.org.uk/art/artworks/martin-pier-and-ocean-p07743

Nina Yoo Project-06-Abstract Clock

sketch

/* Nina Lee Yoo
Section E
nyoo@andrew.cmu.edu
Project-06-Abstract Clock*/

var prevSec;
var millisRolloverTime;
var change = 10

//--------------------------
function setup() {
    createCanvas(300, 300);
    millisRolloverTime = 0;
}

//--------------------------
function draw() {
    background(255,200,200); // My favorite pink
    
    // Fetch the current time
    var H = hour();
    var M = minute();
    var S = second();
    
    // Reckon the current millisecond, 
    // particularly if the second has rolled over.
    // Note that this is more correct than using millis()%1000;
    if (prevSec != S) {
        millisRolloverTime = millis();
    }
    prevSec = S;
    var mils = floor(millis() - millisRolloverTime);
    
    
    var hourBarWidth   = map(H, 0, 23, 0, width);
    var minuteBarWidth = map(M, 0, 59, 0, width);
    var secondBarWidth = map(S, 0, 59, 0, 178);

   

    // the sun is radiating
        noStroke()
        fill(255,205,109)
        ellipse(0,0,mils,mils)

     //sun grows at every hour
      noStroke()
        fill(237,242,109)
        ellipse(0,0,hourBarWidth,hourBarWidth)

        
	 //for the puddle growing every minute
        noStroke();
		fill(108,158,234);
        ellipse(150,200,minuteBarWidth,20);
    

     //for raindrop falling at a rate of a second
        noStroke();
        fill(255);
        triangle(140,secondBarWidth-5,160,secondBarWidth-5,150,secondBarWidth-20);
        fill(255);
        ellipse(150,secondBarWidth,22,22);








    


}



    /*noStroke();
    fill(40);
    ellipse(0, 100, hourBarWidth, 50);
    fill(80);
    ellipse(0, 150, minuteBarWidth, 50);
    fill(120)
    ellipse(0, 200, secondBarWidthChunky, 50);
    fill(160)
    ellipse(0, 250, secondBarWidthSmooth, 50);*/

I wanted to make a raindrop to fall into a puddle because rain is something that has a rythm to it so it reminded me of time. From there on I just added more elements to it pertaining to weather by making the puddles minutes, the drops seconds, the sun the hour, and the radiating part of the sun milliseconds. It was fun doing this project and playing around with the limits in order to create different images.

Elena Deng-Project 6 Abstract Clock

sketch

/*Elena Deng
Section E
  edeng1@andrew.cmu.edu
  Project-06
}
*/

function setup() {
    createCanvas(400, 400);
    // var c=canvas
    // c.rotate(90)
    angleMode (DEGREES);
}

function draw() {

    var H = hour(); //calculates hours
    var M = minute(); //calculates minutes
    var S = second(); //calculates seconds
    var colRatio=2;  //reduces the color gradient each for loop
    noStroke(); //no stroke within the circles

    //does the background
      push();
      translate(200,200); //translates into the middle of the canvas
      background(5,15,53); //sets the background color
      pop();

      //hour hand
      for (var h=0; h<H; h++){
        var r=220; //sets r value
        var g=105; //sets g value
        var b=55; //sets b value
        var colRatio=4; //color value reduces more quickly
          push();
          translate (width/2, height/2);
          rotate((15*h)-.25*360) //24 hour clock
          fill(r+(colRatio*h),g+(colRatio*h),b+(colRatio*h));
          ellipse(35,0,20,20);
          pop();
      }

      //minutes hand
        for(var m =0; m<M; m++){
          var r=250; //sets r value
          var g=175; //sets g value
          var b=65; //sets b value
            push();
            translate (width/2, height/2);
            rotate((6*m)-.25*360); //sets minutes and rotates
            fill(r-(colRatio*m),g-(colRatio*m),b-(colRatio*m));
            ellipse(72,0,15,15);
            pop();
          }


      //seconds hand
        for(var s = 0; s < S; s++) {
        var r=120; //sets r value
        var g=105; //sets g value
        var b=15; //sets b value
        push();
        translate (width/2, height/2); //moves to the middle of canvas
        rotate((6*s)-.25*360); //sets seconds and rotates
        fill(r+(colRatio*s),g+(colRatio*s),b+(colRatio*s)); //sets fill
        ellipse(100,0,10,10);
        pop();
    }


}

This project was pretty fun to do! My favorite part of the result was the color palette as well as the overall effect of the circles. I decided to make it a 24 hour clock so that it can tell the difference between AM and PM.

ideation for Clock (didn’t end up going with these ideas)

Jamie Dorst Project 06 Abstract Clock

sketch

/*
Jamie Dorst
jdorst@andrew.cmu.edu
Section A
Project-06
*/

//VARIABLES
//shelf height
var shelfY = [100, 220, 340, 460];

// flame vertices
var flameX1 = 35;
var flameY1 = 40;
var flameX2 = 45;
var flameX3 = 40;
var flameY3 = 20;
// candle width
var candleW = 30;
// candle x positions array
// 6 variables, same in every column, increasing by 80
var candleX = [25, 105, 185, 265, 345, 425];
// candle y positions array
// 4 variables, same in every row
var candleY = [];
// candle heights
// one for each candle
var candleH = [];
// color arrays
var flameColors = ['orange', 'gold'];
var fColor = 0;
var woodColors = ['saddlebrown', 'peru'];
var wColor = 0;

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

function draw() {
    background('black');
    // time variables
    var h = hour();
    var m = minute();
    var s = second();
    noStroke();

    // WOOD SHELVES
    // alternate wood color every minute
    if (m % 2 === 0) {
        wColor = 0;
    } else {
        wColor = 1;
    }
    // draw four shelves
        fill(woodColors[wColor]);
        rect(0, shelfY[0], 480, 20);
        rect(0, shelfY[1], 480, 20);
        rect(0, shelfY[2], 480, 20);
        rect(0, shelfY[3], 480, 20);

    // CANDLES
    // fill in y position array with 24 values
    // groups of 6, each increasing by 120
    // will change individually later as candles melt
    for (var i = 0; i < 6; i++) {
        candleY[i] = 40;
    }
    for (var i = 6; i < 12; i++) {
        candleY[i] = 160;
    }
    for (var i = 12; i < 18; i++) {
        candleY[i] = 280;
    }
    for (var i = 18; i < 24; i++) {
        candleY[i] = 400;
    }
    // fill in height array with 24 values of 60
    for (var k = 0; k < 24; k++) {
        candleH[k] = 60;
    }
    // one candle melts per hour
    for (var p = 0; p < 24; p++) {
        if (p < h) {
            candleH[p] = 0;
            candleY[p] = 0;
        } else if (p === h) {
            candleH[p] = candleH[p] - (candleH[p] * (m / 60));
            if (h < 6) {
                candleY[p] = shelfY[0] - candleH[p];
            }
            if (h >= 6 & h < 12) {
                candleY[p] = shelfY[1] - candleH[p];
            }
            if (h >= 12 & h < 18) {
                candleY[p] = shelfY[2] - candleH[p];
            }
            if (h >= 18 & h < 24) {
                candleY[p] = shelfY[3] - candleH[p];
            }
        }
    }
    // make four groups of six to draw the candles
    fill('white');
    // first row
    rect(candleX[0], candleY[0], candleW, candleH[0]);
    rect(candleX[1], candleY[1], candleW, candleH[1]);
    rect(candleX[2], candleY[2], candleW, candleH[2]);
    rect(candleX[3], candleY[3], candleW, candleH[3]);
    rect(candleX[4], candleY[4], candleW, candleH[4]);
    rect(candleX[5], candleY[5], candleW, candleH[5]);
    // second row
    rect(candleX[0], candleY[6], candleW, candleH[6]);
    rect(candleX[1], candleY[7], candleW, candleH[7]);
    rect(candleX[2], candleY[8], candleW, candleH[8]);
    rect(candleX[3], candleY[9], candleW, candleH[9]);
    rect(candleX[4], candleY[10], candleW, candleH[10]);
    rect(candleX[5], candleY[11], candleW, candleH[11]);
    // third row
    rect(candleX[0], candleY[12], candleW, candleH[12]);
    rect(candleX[1], candleY[13], candleW, candleH[13]);
    rect(candleX[2], candleY[14], candleW, candleH[14]);
    rect(candleX[3], candleY[15], candleW, candleH[15]);
    rect(candleX[4], candleY[16], candleW, candleH[16]);
    rect(candleX[5], candleY[17], candleW, candleH[17]);
    // fourth row
    rect(candleX[0], candleY[18], candleW, candleH[18]);
    rect(candleX[1], candleY[19], candleW, candleH[19]);
    rect(candleX[2], candleY[20], candleW, candleH[20]);
    rect(candleX[3], candleY[21], candleW, candleH[21]);
    rect(candleX[4], candleY[22], candleW, candleH[22]);
    rect(candleX[5], candleY[23], candleW, candleH[23]);

    // FLAMES
    // alternate flame color every second
    // draw flames
    if (s % 2 === 0) {
        fColor = 0;
    } else {
        fColor = 1;
    }
    fill(flameColors[fColor]);
    // move flames to follow candles
    for (var j = 0; j < 6; j++) {
        if (j === h) {
            flameX1 = candleX[j] + 10;
        }
    }
    for (var j = 6; j < 12; j++) {
        if (j === h) {
            flameX1 = candleX[j - 6] + 10;
        }
    }
    for (var j = 12; j < 18; j++) {
        if (j === h) {
            flameX1 = candleX[j - 12] + 10;
        }
    }
    for (var j = 18; j < 24; j++) {
        if (j === h) {
            flameX1 = candleX[j - 18] + 10;
        }
    }
    flameY1 = candleY[h];
    flameX2 = flameX1 + 10;
    flameX3 = flameX1 + 5;
    flameY3 = flameY1 - 20;
    triangle(flameX1, flameY1, flameX2, flameY1, flameX3, flameY3);
}

For this week’s project, I made a clock based on 24 candles, where the flame changes color every second, the wooden shelves change color every minute, and one candle melts per hour. I wanted to show time as something that we run out of every day, to give perspective on how we use it. I struggled a lot with this project; I didn’t realize how complicated it would be. But, I think I also learned a lot from it and I’m very satisfied that I got it to work in the end.

Joanne Lee – Project 06

Project-06

// Joanne Lee
// Section C
// joannele@andrew.cmu.edu
// Project-06

var skyR = 135;
var skyG = 206;
var skyB = 235;
var grassR = 206;
var grassG = 229;
var grassB = 178;


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

function draw() {

  // hour hand -- represented by background colors // 12 hr clock
  var h = hour() % 12;
  noStroke();
  background(skyR - 10 * h, skyG - 20 * h, skyB - 20 * h); // sky --> darkens every 12 hours
  fill(grassR - 30 * h, grassG - 50 * h, grassB - 20 * h, 99); // darkens every 12 hours
  triangle(0, height * 0.75, 0, height, 1500, height); // plain 1
  triangle(width, height * 0.55, width, height, -1500, height); // plain 2

  // minute hand -- represented by the sun position
  var m = minute() / 60;

  push();
  noStroke();
  if (m < 0.25 || m > 0.75) { // make opaque when not in sky
    fill(255, 200, 100, 50);
  }
  else {
    fill(255, 200, 100);
  }
  translate(width / 2, height / 2);
  rotate(radians(m * 360));
  ellipse(0, 200, 60, 60);
  pop();

  // second hand -- represented by the clouds
  var s = second() / 60;
  var x1 = -80; // x-values to keep cloud off screen, keeping continuous movement
  var x2 = -120;
  var x3 = -40;
  var shift = (width+160) * s; // move across screen proportionally

  push();
  noStroke();
  fill(255);
  ellipse(x1 + shift, 110, 120, 65);
  ellipse(x2 + shift, 110, 90, 45);
  ellipse(x3 + shift, 116, 100, 40);
  pop();
}

Going into the project, I knew I wanted to make use of background color changes as well as real elements on the screen moving (i.e. cloud, sun).

The hour hand is denoted by the change in sky / grass color. Over the progression of 12 hours, the sky and grass becomes darker in color. I chose to do a 12 hour clock because I wanted the hour hand differences to be more apparent. The minute hand is denoted by the position of the sun. As you can see in my sketch below, I originally intended for the sun to go off screen, but I wanted it to be more clear what the current minutes were. Therefore, I decided to keep it on the screen and make it more opaque as to not draw too much attention through the grass. And finally, the seconds are denoted by the pace of the cloud moving across the screen in what appears to be a continuous loop. I personally found this project to be one of the most interesting projects to work on so far.

Original sketch for abstract clock