Project-06-Abstract Clock

For the clock I wanted to create something that had a gradient, and where the time could not always be seen at every second, to get people to focus a bit more on the changing condition. Eventually I settled on a clock which had a gradient of boxes which changed every two seconds, and slowly revealed the time in the middle of the smallest box, with circles. I also liked the idea of using the same shape for both the minutes and hours, with only the size to differentiate the two.

sketchDownload
var theta = [];
var side = [];
var c = [];
var s;
var h;
var mx = [];
var my = [];


function setup() {
    createCanvas(480, 480);
    background(220);

    h = hour();

    for (let i = 0; i <= 29; i++) {
      theta[i] += 2;
      c[i] = ((8.5*i));
      if (i == 0) {
        side[i] = 480
      } else if (i > 0) {
        side[i] = (side[i-1])-((side[i-1])/40);
      }
    }

    for (let i = 0; i < 60; i++) {
      if (i %6 == 0) {
        mx[i] = -5;
      } else {
        mx[i] = mx[i-1]+20;
      }
      if (i < 6) {
        my[i] = -90;
      } else {
        my[i] = my[i-6]+20;
      }
    }
}

function draw() {
  s = floor((second())/2);
  translate(240,240);
  rectMode(CENTER);

  for (let i = 0; i <= s; i++) {
    noStroke();
    rotate(radians(theta[i]));
    fill(c[i]);
    rect(0,0,side[i],side[i]);
  }

  if (h > 12) {
    h = h-12;
  }

  if (h < 7) {
    for (let i = 1; i <= h; i ++) {
      fill(0);
      circle(-80,-122+(i*35),30);
    }
  } else {
    for (let i = 1; i <= 6; i ++) {
      circle(-80,-122+(i*35),30);
    }
    for (let i = 1; i <= h-6; i++) {
      circle(-45,-122+(i*35),30);
    }
  }

  for (let i = 0; i < minute(); i++) {
    circle(mx[i],my[i],17);
  }
}

Project 06-Abstract Clock

project-06-abstractClock
/*
Lauren Kenny
lkenny@andrew.cmu.edu
Section A
Project-06

This program draws an abstract clock that changes over time.

*/

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

function draw() {
    var c=255-(hour()*10.5);
    background(c);
    var s=second();
    var m=minute();
    var h=hour();
    var mx=10;
    var sx=11;
    var hx=10;

    //draws the hours
    for (H=0; H<h; H++) {
        var y=10;
        var width=15;
        var height=50;
        var dx=18;
        fill(230, 180, 170);
        rect(hx, y, width, height);
        hx+=dx;
    }

    //draws the minutes
    for (M=0; M<m; M++) {
        var y=65;
        var width=2;
        var height=25;
        var dx=8;
        fill(250,120,120);
        rect(mx, y, width, height);
        mx+=dx;
    }

    //draws the seconds
    for (S=0; S<s; S++) {
        var y=95;
        var width=2;
        var dx=8;
        if (c>150) {
            fill(0);
        }
        else {
            fill(255);
        }
        circle(sx, y, width);
        sx+=dx;
    }  
}

For this project, I wanted to create a clock that visually showed the number of hours, minutes, and seconds. I chose to have this be a 24 hour clock as opposed to 12 hours because 12 hour clocks make no sense. To do this, I created for loops that presented n number of objects based on the number of hours/minutes/seconds. I decided that hours were most important and then minutes and then seconds so I created visual size differences to reflect that logic. Also, I wanted there to be some reflection of the natural world, so I have the background getting gradually darker with each passing hour. I found the hour(), minute(), and second() built-ins to be quite confusing, but it is quite exciting to see them actually working.

Project 6 – Abstract Clock

I was inspired by the idea of the lunar cycles and the moon’s effect on the oceans for this project.

sketch
//hollyl
//abstract clock assignment
//section D

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

function h(){								//hour wave
	var x = hour()*20;
	var y = width/2;
	noStroke();
	fill(58, 63, 139);
	rect(x-120, y/2, 240, y/2);
	ellipse(x, y/2, 120, y);
	rect(0, y, 480, y);
	fill(30, 30, 75);
	arc(x-120, y/2, 120, y, 0, PI);
	arc(x+120, y/2, 120, y, 0, PI);
}

function mn(){								//minute wave
	var x = minute()*8;
	var y = 180
	noStroke();
	fill(58, 91, 139);
	rect(x-90, height/2, y, y/2);
	ellipse(x, height/2, 90, y);
	rect(0, 330, 480, y);
	fill(58, 63, 139);
	arc(x-90, height/2, y/2, y, 0, PI);
	arc(x+90, height/2, y/2, y, 0, PI);
}

function s(){								//second wave
	var x = second()*8;
	var y = 120;
	noStroke();
	fill(59, 104, 172);
	rect(x-(y/2), 330, y, y/2);
	ellipse(x, 330, y/2, y);
	rect(0, height-90, 480, 90);
	fill(58, 91, 139);
	arc(x-(y/2), 330, y/2, y, 0, PI);
	arc(x+(y/2), 330, y/2, y, 0, PI);
}

function draw(){
	background(30, 30, 75);
	h();
	mn();
	s();
	fill(54, 146, 169);						//remnants of the millisecond wave that
	rect(0, height-45, 480, 45);			//moved way too fast
}

Notes:

LO: Randomness in Comic Art

In exploring randomness used as a generative tool in computational art, I came across a randomly computer-generated comic by John Pound.

The program used to create this comic pulls from a database of random words, colors, shapes, figures, objects and scenes in order to create these comic pages. Playing off the “Sunday Comic” aesthetic and subject matter, Pound wanted to explore the parameters we set for ourselves as comic-writers and comic-readers. What are the minimum requirements needed to deem something a comic? To what extent can we abstract and randomize something yet have it remain fully recognizable (in this case a page of comic panels)?

This piece makes me think about the purpose of randomness in the ways we conduct our lives; to what extent are we truly in control of our lives? If a randomly computer-generated sequence of elements can register as an everyday comic, how much of our everyday lives are in fact random and out of control? We may, in fact, subconsciously prompt ourselves to recognize these occurrences as something intentional that we have crafted.

Project 06 – Mike Pence and Fly Clock

I chose to represent time with the fly from the Vice Presidential debate that landed on Mike Pence’s head. The fly moves each second and crosses the canvas once per minute. Its vertical position represents what minute of the hour it is, and the number of time it says “vote” on the top of the canvas is the hour. If the background is darker than the text, it is PM, and vice versa.

mike pence fly
var FlyY = 5

function setup() {
    createCanvas(480, 480);
    background(220);
}
//draw the fly 
function Fly(){
		var x = 0
		push();
		fill(154, 137, 120);
		rotate(radians(-60));
		ellipse(x - 2, FlyY - 12, 7, 18);	//draw top wing
		rotate(radians(120));
		ellipse(x + 5, FlyY + 8, 7, 18);	//draw bottom wing
		pop();
		stroke(154, 137, 120);
		fill(0);
		circle(x, FlyY, 12);	//draw fly body
	}

//draw mike pence
function Mike(){
	noStroke()
	//shirt
	beginShape();
	fill(241, 237, 234);
	curveVertex(218,346);
	curveVertex(187,374);
	curveVertex(171,395);
	curveVertex(179,479);
	curveVertex(278,479);
	curveVertex(295,391);
	curveVertex(261,351);
	endShape(CLOSE);

	//left shoulder
	fill(0);
	beginShape();
	vertex(172,268);
	vertex(127,282);
	vertex(87,298);
	vertex(44,323);
	vertex(0,331);
	vertex(0,479);
	vertex(193,479);
	vertex(172,380);
	vertex(160,300);
	endShape(CLOSE);

	//right shoulder
	beginShape();
	vertex(325,286);
	vertex(334,294);
	vertex(351,312);
	vertex(396,330);
	vertex(448,354);
	vertex(479,368);
	vertex(479,479);
	vertex(258,479);
	vertex(289,402);
	vertex(316,304);
	endShape(CLOSE);

	//left ear
	fill(236, 166, 133);
	beginShape();
	curveVertex(185,145);
	curveVertex(175,127);
	curveVertex(167,133);
	curveVertex(165,149);
	curveVertex(165,177);
	curveVertex(165,201);
	curveVertex(168,214);
	curveVertex(175,217);
	endShape(CLOSE);

	//right ear
	beginShape();
	curveVertex(363,203);
	curveVertex(378,194);
	curveVertex(388,198);
	curveVertex(387,214);
	curveVertex(371,231);
	curveVertex(359,252);
	curveVertex(349,267);
	curveVertex(339,272);
	curveVertex(331,263);
	endShape(CLOSE);

	//neck
	beginShape();
	curveVertex(181,251);
	curveVertex(172,288);
	curveVertex(183,309);
	curveVertex(195,323);
	curveVertex(223,353);
	curveVertex(242,358);
	curveVertex(279,342);
	curveVertex(309,317);
	curveVertex(317,290);
	endShape(CLOSE);

	//right collar
	fill(255)
	beginShape();
	curveVertex(329,279);
	curveVertex(282,335);
	curveVertex(260,347);
	curveVertex(243,355);
	curveVertex(261,376);
	curveVertex(273,407);
	curveVertex(281,427);
	curveVertex(313,362);
	curveVertex(323,315);
	endShape(CLOSE);

	//face
	fill(244, 180, 150)
	beginShape();
	curveVertex(232,81);
	curveVertex(213,114);
	curveVertex(198,145);
	curveVertex(185,166);
	curveVertex(177,199);
	curveVertex(175,237);
	curveVertex(181,279);
	curveVertex(193,307);
	curveVertex(211,328);
	curveVertex(238,340);
	curveVertex(273,335);
	curveVertex(299,321);
	curveVertex(322,291);
	curveVertex(341,257);
	curveVertex(360,214);
	curveVertex(361,187);
	curveVertex(362,143);
	curveVertex(357,101);
	curveVertex(335,116);
	curveVertex(289,103);
	curveVertex(255,87);
	endShape(CLOSE);

	//right hair
	fill(241, 237, 234);
	beginShape();
	curveVertex(363,74);
	curveVertex(380,95);
	curveVertex(387,130);
	curveVertex(375,171);
	curveVertex(357,217);
	curveVertex(356,122);
	curveVertex(356,104);
	endShape(CLOSE);

	//left hair
	fill(255);
	beginShape();
	curveVertex(254,36);
	curveVertex(219,54);
	curveVertex(199,84);
	curveVertex(190,112);
	curveVertex(184,136);
	curveVertex(180,183);
	curveVertex(209,132);
	curveVertex(233,87);
	curveVertex(277,100);
	curveVertex(323,114);
	curveVertex(341,116);
	curveVertex(358,100);
	curveVertex(363,79);
	curveVertex(352,60);
	curveVertex(327,40);
	curveVertex(295,30);
	endShape(CLOSE);

	//collar
	beginShape();
	curveVertex(177,255);
	curveVertex(165,273);
	curveVertex(162,307);
	curveVertex(170,357);
	curveVertex(178,406);
	curveVertex(181,418);
	curveVertex(209,376);
	curveVertex(231,354);
	curveVertex(195,320);
	curveVertex(177,289);
	endShape(CLOSE);	

	//tie bottom
	fill(184, 14, 18);
	beginShape();
	curveVertex(223,394);
	curveVertex(209,430);
	curveVertex(196,478);
	curveVertex(261,479);
	curveVertex(257,433);
	curveVertex(239,392);
	endShape(CLOSE);

	//tie knot
	fill(229, 25, 30);
	beginShape();
	curveVertex(225,354);
	curveVertex(201,379);
	curveVertex(221,398);
	curveVertex(246,402);
	curveVertex(264,380);
	curveVertex(256,360);
	endShape(CLOSE);

}

function draw(){
	if(hour()>11){
		background(117, 129, 151);	//in PM, set background color to darker blue
	}
	else {
		background(158, 168, 186)	//in AM, set background color to lighter blue
	}
	
	push()
	for(var h = 0; h<(hour()%12); h++){	//this will write'vote' the number of the hour up on a 12 hour scale
		push()
		translate(40*h,0) //space out the'vote' evenly so 12 can fit on the top row
		if(hour()>11){
			fill(158, 168, 186)	//in PM, set text color to lighter blue
		}
		else{
			fill(117, 129, 151)	//in AM, set text color to darker blue
		}
		textFont('Georgia')
		textSize(20)
		text('vote', 2, 25)	//vote text
		pop()
    }
	pop()
	Mike();	//draw mike pence
	push();
	translate(map(second(), 0, 60, -15, width + 10), FlyY);	//translate so the fly moves each second and crosses the canvas once a minute
	translate(0, map(minute(), 0, 60, 0, height));	//translate so the y position of the fly corresponds with the minute of the hour, so the top will be the top of the hour and vice versa
	Fly();	//draw the fly
	pop();
	
}



Project 06 – Abstract Clock

I recently saw a tv show that talked about fish. It reminded me of my goldfish I used to take care of for 7 years, but died just a few months before I graduated high school. In memories of my goldfish, I wanted to create an abstract clock of a fish tank in space on an unknown planet. Each tank represents hours, minutes, and seconds as the water fills up the tank.

sketch
//Stefanie Suk
//ssuk@andrew.cmu.edu
//15-104 Section D

var fishx = 15; //width of fish
var fishy = 10; //height of fish

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

function draw() {
    var h = hour();
    var m = minute();
    var s = second();

    var starx = random(0, 600);   //random x position of stars
    var stary = random(0, 250);   //randolm y position of stars

    background(50); //background color

    //moon and stars
    fill("yellow");
    ellipse(70, 70, 100, 100);  //moon at top left 
    ellipse(starx, stary, 5, 5);  //stars randomly placed

    //light brown base of planet
    fill(184, 165, 162)
    rect(0, 250, width, 200);  

    //darker brown oval holes on planet, left to right
    fill(158, 142, 140);
    strokeWeight(6);
    stroke(0);
    ellipse(30, 300, 100, 40);
    ellipse(100, 380, 100, 40);
    ellipse(300, 290, 100, 40);
    ellipse(400, 350, 100, 40);
    ellipse(600, 280, 100, 40); 

    //mapping time to fit in the fish tank
    mS = map(s, 0, 70, 0, 110);
    mM = map(m, 0, 70, 0, 110);
    mH = map(h, 0, 30, 0, 110); 
    
    //hour tank on left, dark blue
    strokeWeight(5);
    stroke(255);
    fill(31, 56, 240);
    rect(120, 150, 100, 100);  
    
    //minute tank in middle, dark blue
    stroke(255);
    fill(31, 56, 240);
    rect(260, 150, 100, 100); 
    
    //second tank on right, dark blue
    stroke(255);
    fill(31, 56, 240);
    rect(400, 150, 100, 100);  

    //three fish in each tank right to left
    strokeWeight(1);
    stroke(0);
    fill(255, 169, 157);
    ellipse(420, 230, fishx, fishy);
    triangle(427, 230, 435, 225, 435, 235);
    ellipse(320, 200, fishx, fishy);
    triangle(313, 200, 305, 195, 305, 205);
    ellipse(190, 215, fishx, fishy);
    triangle(197, 215, 205, 210, 205, 220);  

    //time rect in tank changing upwards, light blue
    noStroke();
    fill(157, 185, 255);
    rect(122.5, 152, 95, 95 - mH); //hour
    fill(157, 185, 255); 
    rect(262.5, 152, 95, 95 - mM); //minute
    fill(157, 185, 255);
    rect(402.5, 152, 95, 95 - mS); //second

}
Sketch

Project-06: Abstract Clock

For the Abstract Clock project, I used a grid of 24 circles to denote the hour and the red circle as the second hand

https://editor.p5js.org/ssahasra/full/YVNbtFtzJ

[the p5.js embed code was not rendering so I uploaded a video of the p5.js preview]

https://editor.p5js.org/ssahasra/sketches/YVNbtFtzJ

LO-06: Paintings with Randomness

https://dhruvkaran.com/recreating-paintings-with-generative-art/https://dhruvkaran.com/recreating-paintings-with-generative-art/

Taking inspiration from the work of Jackson Pollock, I was interested in finding interesting ways in which artists have applied randomness in generative art, specifically using concepts like the random walk.I stumbled upon a website called Unography Mag where several famous paintings are recreated using randomness principles.

Based on this, artist Dhruv Karan recreated Vincent Van Gogh’s self-portrait is an appropriate example of using randomness in generative art. What I particularly enjoy about this work is that it gradually reveals the full picture, so someone watching it can spend time trying to guess what the picture is and therefore be engaged in the artwork. Applying Brownian motion and Perlin noise, Dhruv Karan used the tracing of the line across the canvas like a digital paintbrush.

It seems like while defining how the random walk of the line will happen, the algorithm uses a certain mapping of color to paint the picture, so a line on it’s a path in a way “deposits” color on the canvas to reveal a part of the painting. He also describes how pixels can be assigned rgb values for this artwork. It reminds me of how pointillism was used in painting, where the smallest unit is a point or pixel.

Project 06 Abstract Clock

In this project the aim was to create various patterns based on numerical operations on the values of time it self. The resulting clock behaves more like a timer, that resets every 20 seconds. There are in reality 6 different types of patterns that can be created based on manipulating the numeric value of seconds, but by overlaying two 10 second patterns, there begins to be a higher level of nuance to the resulting geometries.

sketch
//tjchen
//section a
//abstract clock

var angle = 0;
var r = 0; // distance from center 
var framecount= 0;

function setup() {
    createCanvas(480, 480);
    background(0);
    noStroke();
    frameRate(60);
}

function draw() {
//map time to color
    var minutecolor = map(minute(),0,59,0,255);
    var secondcolor = map(second(),0,59,0,255);
//reset's stopwatch after 20 seconds 
    if(second()%20==0){
        fill(0);
        square(0,0,width);
    }
//new pattern every 10 seconds
    if (second()%10 === 0){
        angle=0;
        r = 0 ;
        framecount = 0;
    }
    var cenX = (width/2);
    var cenY = (height/2);
//draw circles 
    push();
    translate(cenX,cenY);
    x = r*cos(radians(angle));
    y = r*sin(radians(angle));
    fill(random(255),minutecolor,secondcolor);
    circle(x,y,3);
    r += 0.75;
// creates circle pattern 
    angle += map(second(),0,59,0,360); 
    pop();
    framecount+=1
}

Project 6: Abstract Clock

abstract clock cb
function setup() {
    createCanvas(480, 480);
    angleMode(DEGREES);
}

function draw() {
    background(241, 225, 174);
    
    //background elements art
    stroke(0);
    noFill(); 
    ellipse(300, 360, 90); //minute ellipse outline
    triangle(350, 30, 430, 90, 410, 105); //top r corner triangle
    fill(41, 72, 108, 220); //blue quad
    quad(170, 100, 190, 270, 290, 320, 60, 450);
    fill(41, 72, 108, 180); //blue circle
    ellipse(300, 160, 40);
    fill(120, 79, 58, 220); //brown quad
    quad(50, 160, 130, 370, 340, 465, 180, 350);
    fill(226, 170, 56, 150); //yellow circles
    ellipse(110, 300, 130);
    ellipse(180, 30, 30);
    
    push();
    noStroke();
    fill(192, 50, 47, 220);  //red triangle and ellipse
    triangle(80, 35, 135, 90, 20, 130);
    ellipse(230, 450, 25);
    fill(120, 79, 58, 200); //brown triangle
    triangle(270, 240, 430, 380, 240, 350);
    fill(0);    //black triangle
    triangle(380, 350, 440, 400, 370, 390);
    pop();

    //hours red arc
    push();
    translate(300, 200);
    rotate(-135);
    hr();
    pop();

    //wavy lines
    push();
    noFill();
    strokeWeight(2);
    strokeCap(SQUARE);
    translate(370, 200);
    rotate(30);
    bezier(40, -40, -40, -40, 40, 40, -40, 45);
    translate(10, 10);
    bezier(35, -35, -40, -40, 35, 35, -20, 35);
    pop();

    //minutes yellow arc
    push();
    translate(300, 360);
    rotate(-90);
    scale(.5);
    mins();
    pop();

    //seconds black line
    push();
    translate(240, 240);
    rotate(-135);
    sec();
    pop();
}

//hours, minutes, seconds functions
function hr() {
    var h = hour();
    noFill();
    strokeCap(SQUARE);
    strokeWeight(10);
    stroke(192, 50, 47);
    var hourHand = map(h % 24, 0, 24, 0, 360);
    arc(0, 0, 200, 200, 0, hourHand);
}

function mins() {
    push();
    var m = minute();
    noFill();
    strokeCap(SQUARE);
    strokeWeight(80);
    stroke(226, 170, 56, 200);
    var minHand = map(m, 0, 60, 0, 360);
    arc(0, 0, 100, 100, 0, minHand);
    pop();
    push();
    fill(0);
    ellipse(0, 0, 50);
    pop();
}

function sec() {
    var s = second();
    strokeCap(SQUARE);
    strokeWeight(10);
    stroke(0);
    var secHand = map(s, 0, 60, 0, 360);
    rotate(secHand);
    line(0, 0, 150, 150);
}

For my project, I was inspired by Bauhaus art and design and decided to make an abstract clock based on abstract artwork. When I started the project, I knew I wanted to use a combination of basic graphic elements to represent time instead of making a representational scene. After looking through some Bauhaus work, I found Kandinsky’s “Arch and Point” (1923). I think that the composition and interaction of shapes is really pleasing in this painting.

I did some quick sketches to think about what elements could represent elements of time. I simplified the composition to capture the most prominent elements of the piece and used the red arc to represent hours, the yellow arc to represent minutes, and the black line to represent seconds for a 24-hour clock.

“Arch and Point” by Kandinsky
digital sketch