Clock: The Whoring Hours

approx 12am

A screen shot taken around midday.

The work day in Amsterdam’s Red Light District runs from about 7pm till 3am. This is a sped-up render of a visual clock representing that work period across the world. The image consists of 24 bars, that can be turning on, on or off. Each bar represents a time zone, and there is a small cross on the bar that shares the time zone of the clock (in this case the US east coast). It’s intended as a reminder of what is currently happening across the world, either near or far, and the stories of the people involved. This is a rendering of the change across time sped up:

code:

//The Whoring Hours. This might belong in a sports bar.


// function that handles the drawing of the light. Could be kept 
// within the bar class
void drawBar( int sx, int sy, int ex, int ey, float dx, 
              color lowC, color highC){
  int lr = int(red(lowC));
  int lg = int(green(lowC));
  int lb = int(blue(lowC));
  int dr = int(red(highC)) - lr;
  int dg = int(green(highC)) - lg;
  int db = int(blue(highC)) - lb;
  stroke(lr,lg,lb, int(100*dx));
  strokeWeight(40);
  line(sx,sy,ex,ey);
  stroke(lr + dr/3,lg + dg/3,lb + db/3, int(150*dx));
  strokeWeight(20);
  line(sx,sy,ex,ey);
  stroke(lr + int(dx*2*dr/3),lg + int(dx*2*dg/3),
         lb + int(dx*2*db/3),int(200*dx));
  strokeWeight(7);
  line(sx,sy,ex,ey);
  stroke(lr + int(dr*dx*dx),lg + int(dg*dx*dx),
         lb + int(db*dx*dx),int(255*dx*dx));
  strokeWeight(2);
  line(sx,sy,ex,ey);
  fill(0);
  noStroke();
  rect(sx-20,sy-40,40,40);
  rect(ex-20,ey,40,40);
              }

//class for each of the light bars that represent a time zone
class Light {
  String name;
  int diff;
  int sStart;
  int hStart;
  int sEnd;
  int hEnd;
  int x;
  int y;
  //int alpha;
  //int r;
  float dl;
  
  Light( String tempName, int tempDiff, int tempSS, int tempHS,
         int tempSE, int tempHE, int tempX, int tempY){
    name = tempName;
    diff = tempDiff;
    sStart = tempSS;
    hStart = tempHS;
    sEnd = tempSE;
    hEnd = tempHE;  
    x = tempX;
    y = tempY; 
    dl = 0.0;
  }
  
  //gets the relative brightness (dh) based on time of day and
  //time difference
  void update(int h, float dh){
    int nh = (h + diff) % 24;
    if ((nh >= hEnd) && (nh < sStart)){
      dl = 0.0;
    }  
    else if (nh >= hStart || nh < sEnd){
      dl = 1.0;
    }
    else if (nh == sStart){
      dl = dh;
    }
    else {
      dl = 1-dh;
    }
  }
  
  void display(){
    drawBar( x,y,x,y+200, dl, color(255,0,0),color(255,255,255)); 
    textAlign(CENTER);
    fill(160,190,190);
    text(name,x,y+220);
  }
}

ArrayList<Light> lights;

void setup(){
  size(1200,300);
  lights = new ArrayList<Light>();
  for( int i = -4; i<20; i ++){
    lights.add(new Light("", i, 19,20, 2,3, (i+5)*width/25,50));
  }
}

void draw(){
  int s = second();
  int m = minute();
  int h = hour();
  float dh = float(m)/60 + float(s)/(60*60);
  background(10);
  for (int i = lights.size()-1; i >= 0; i--) {
    Light light = lights.get(i);
    light.update(h,dh);
    light.display();
  }
  fill(200,200,200);
  textAlign(LEFT);
  textSize(15);
  text("The Whoring Hours:",15,30);
  stroke(200,200,200);
  strokeWeight(1);
  line((5*width/25)-5,270,(5*width/25)+5,270);
  line((5*width/25),265,(5*width/25),275);
}

 

Comments are closed.