blase-13-9-65

by blase @ 2:58 am 24 January 2012
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
// blase ur, imitation of 13/9/65 Nr. 2 by Frieder Nake
void setup() 
{
  size(500,500);
}
 
void draw() 
{
  // defining the circles
  int circlesNumber = 9;
  int circlesMaxSize = 100;
  float circlesLeftBias = 0.85;  // the circles seem to be biased towards the left
  // defining the horizontalish lines
  int linesNumber = 9;
  int linesAverageSegments = 7;
  float linesMaxChange = 0.12;  
  float linesTolerance = 0.4;
  float linesVerticalTolerance = height/linesAverageSegments*0.1;
  // create a background
  background(255,255,255);
  // draw circles
  drawCircles(circlesMaxSize,circlesLeftBias,circlesNumber);
  // draw lines (randomly choosing vertical vs. spider)
  float[] prevl = {0,0,width,0}; // prev1 is the previous line (going from the top), and nextl is the next one.
  float[] nextl; // we keep track of this so we can connect them with lines
  for(int n=0; n<linesNumber; n++) // loop through the horizontalish lines
  {
    nextl = linePoints(linesAverageSegments, linesMaxChange, linesTolerance, height/(linesNumber+1)*(n+1)+random(linesVerticalTolerance*-1,linesVerticalTolerance));
    drawLines(nextl); // draw the horizontalish line
    makeLines(prevl,nextl); // draw the vertical or spider lines in between the previous and current line
    prevl = nextl;
  }
  float[] lastl = { 0,height,width,height };
  makeLines(prevl,lastl); // draw the vertical or spider lines in between the previous and the bottom of the screen
  delay(2796);
}
 
void makeLines(float[] p, float[] n) // this function decides where to put lines from left to right, setting their boundaries.  it then randomly calls the vertical or spider lines function to draw those lines
{
 float minwidth = width*.05;
 float maxwidth = width*.15;
 int howmany = round(random(2,7));
 int h = 1;
 float[] startSpots = new float[howmany];
 float[] endSpots = new float[howmany];
 startSpots[0] = random(0,width-maxwidth);
 endSpots[0] = startSpots[0] + random(minwidth,maxwidth);
 boolean found = false;
 while(h<howmany)
 {
   float candidatestart = random(0,width-maxwidth);
   float candidatestop = candidatestart + random(minwidth,maxwidth);
   found = false; // this is a sentinel variable to make sure we don't have groups of either spider or vertical lines overlapping from left to right
   for(int t=0; t<h; t++)
   {
     if(((startSpots[t]candidatestart)) || ((startSpots[t]candidatestop)))
     {
       found = true;
       break;
     }
   }
   if(!found) // we're not overlapping, so randomly choose either vertical or spider and then call the function to draw it
   {
     startSpots[h] = candidatestart;
     endSpots[h] = candidatestop;
     if(random(1)<0.5)
     {
      verticalLines(startSpots[h],endSpots[h],p,n);
     }
     else
     {
       spiderLines(startSpots[h],endSpots[h],p,n);
     } 
     h = h+1;
   }
 }
}
 
void verticalLines(float spot1, float spot2, float[] p, float[] n) // draw vertical lines between the lines defined by p and n between the horizontal coordinates spot1 and spot2
{
  int minlines = 7;
  int maxlines = 14;
  int numlines = int(random(minlines,maxlines));
  // println("making " + numlines + " lines bw " + spot1 + " and " + spot2);
  for(int k=0; k<numlines; k++) // choose points
  {
    float xcoords = random(spot1, spot2);
    line(xcoords, giveYcoord(xcoords,p), xcoords, giveYcoord(xcoords,n));
   }
}
 
void spiderLines(float spot1, float spot2, float[] p, float[] n) // draw spider lines between the lines defined by p and n between the horizontal coordinates spot1 and spot2
{
  int minlines = 2;
  int maxlines = 7;
  int bottomlines = int(random(minlines,maxlines));
  int toplines = int(random(minlines,maxlines));
  for(int k=0; k<bottomlines; k++) // choose points for bottom
  {
    float xcoords = random(spot1, spot2);
    float xcoords1 = random(spot1, spot2);
    float xcoords2 = random(spot1, spot2);
    line(xcoords, giveYcoord(xcoords,p), xcoords1, giveYcoord(xcoords1,n));
    line(xcoords, giveYcoord(xcoords,p), xcoords2, giveYcoord(xcoords2,n));
   }
  for(int k=0; kpts[i])
  {
    i = i+2;
  }
  float totalRun = pts[i] - pts[i-2];
  float totalRise = pts[i+1] - pts[i-1];
  return pts[i-1] + (x-pts[i-2])/totalRun*totalRise;
}
 
void drawLines(float[] pts) // draw horizontalish lines
{
 int i = 2;
 while(pts[i]!=0)
 {
   line(pts[i-2],pts[i-1],pts[i],pts[i+1]);
   i += 2;
 } 
}
 
float[] linePoints(int seg, float change, float tol, float startingHeight) // generate a set of points defining the segments for the horizontalish lines.  returns in the form {x0,y0,x1,y1,x2,y2,...}
{
  float variance = width/seg*tol;
  float[] pts = new float[100];
  pts[0] = 0.0;
  pts[1] = startingHeight;
  int xi = 0;
  while(pts[xi]width)
    {
      pts[xi] = width; // next x
      pts[xi+1] = pts[xi-1] + (width-pts[xi-2])*delta; // next y
    }
    else
    {
      pts[xi] = pts[xi-2] + nextSeg; // next x
      pts[xi+1] = pts[xi-1] + nextSeg*delta; // next y
    }
  }  
  return pts; 
}
 
void drawCircles(int maxsize, float leftbias, int howmany) // draw howmany number of non-overlapping circles of random diameter up to maxsize
{
  int circlek = 0;
  float[] prevradius = new float[howmany];
  float[] prevx = new float[howmany];
  float[] prevy = new float[howmany];  
  while(circlek<howmany)
  {
    int circleSize = int(random(1,maxsize));
    int hCenter;
    if(random(1)<leftbias) // more circles seemed to be on the left in the original.  copy that by biasing towards the left side of the screen
    {
      hCenter = int(random(1+circleSize/2,width/2-1));
    }
    else
    {
      hCenter = int(random(width/2,width-1-circleSize/2));    
    }
    int vCenter = int(random(1+circleSize/2,height-1-circleSize/2));
    boolean allcool = true;
    for(int a = 0; a<circlek; a++) // make sure we don't overlap
    {
      if(sqrt(sq(prevx[a]-hCenter)+sq(prevy[a]-vCenter)) = sum of radii
      {
        allcool = false;
        break;
      }
    }
    if(allcool) // we don't overlap
    {
      prevradius[circlek] = circleSize/2;
      prevx[circlek] = hCenter;
      prevy[circlek] = vCenter;
      noFill();
      ellipse(hCenter, vCenter, circleSize, circleSize);  
      circlek = circlek+1;
    }
  }
}

Joe Medwid – 13-9-65

by Joe @ 2:43 am

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
// Initialize VERY IMPORTANT variables
PVector[] horiz;
 
float currentYHeight;
void setup() {
  size(700, 700);
  background(255);
  smooth();
  noLoop();
  currentYHeight = 0;
    horiz = new PVector[9]; //horiz as in bottom border of line
}
 
 
void draw() { 
 
  // Variables
 
  PVector[] horiz2 = new PVector[9];
  horiz2[0] = new PVector(20, 20);
  float numCircles = random(6,8); 
  float[] sizeMult = {0,(-.5),(.5)};
  float currDist = 660;
  float prevPoint = 20;
  // Box
  rect(20, 20, 660, 660); 
 
  // Circle Construction
  for (int i = 0; i < numCircles; i++){
    float d = random(2,100);
    float xCirc = random(20+(d+1),660-(d+1));
    float yCirc = random(20+(d+1),660-(d+1));
    noFill();
    ellipse(xCirc, yCirc, d, d);
  }  
 
 
   float [] xCoord = new float[9]; //stores values for x lines dividing cols 
   xCoord[8] = 680;
   xCoord[0] = 20;
 
   // Columns
   for (int i = 0; i < 7; i++){ 
     int rand = int(random(1,3));
     float avg = currDist/(8-i);
     float x1 = avg + (avg * sizeMult[rand]);
    //line(prevPoint+x1, 20, prevPoint+x1, 680);
     prevPoint = prevPoint + x1;
     currDist = currDist - x1;
     xCoord[i+1] = prevPoint;
   }
 
  float ranY;
 
   // Make the Lines //
 
   for (int x = 0; x < 10; x++){  // 10 rows // 9
 
       if (x==0){
         //if it's the first iteration then top line is border 
           for (int z = 0; z < 9; z++){ 
             horiz2[z] = new PVector(xCoord[z], 20);}
 
            for (int z =1; z<9; z++) {
              line(horiz2[z-1].x, horiz2[z-1].y, horiz2[z].x, horiz2[z].y);}
       }
       // if it's the last, it's also a border
       if (x==9) {
         for (int z = 0; z < 9; z++){ 
             horiz[z] = new PVector(xCoord[z], 680);}
       }
       else {
           currentYHeight = currentYHeight + random(30,100);
 
          //create horiz 1
           for (int i = 0; i < 9; i++){ 
 
             ranY = currentYHeight - random(-15,15);
             if (ranY  680) {
                     ranY=680;
                 }
 
             horiz[i] = new PVector(xCoord[i], ranY);
             print(horiz2[i] + "vs/.  " +  ranY + "\n");
 
          }
 
           for (int i=1; i<9; i++) {
 
             line(horiz[i-1].x, horiz[i-1].y, horiz[i].x, horiz[i].y);
           }
 
       }
 
       //Fill the boxes with interesting things
       for (int j=0; j= 85){
           // Draw Lines!
         int verticalLinesTotal = int(random(4,11)); 
         for (int i=0; i= 70 && randDraw < 85){
          // Draw Triangles!
            int triangleTotal = int(random(5,10)); 
         for (int i=0; i= 55 && randDraw < 70){
           // Draw Triangles coming from the other direction!
            int triangleTotal = int(random(5,10)); 
         for (int i=0; i<triangleTotal; i++) {
            //find random X
            int ranX = int(random(xCoord[j],xCoord[j+1]));
            int ranX2 = int(random(xCoord[j],xCoord[j+1]));
            int ranX3 = int(random(xCoord[j],xCoord[j+1]));
 
            float m1 = (horiz2[j+1].y - horiz2[j].y) / (horiz2[j+1].x - horiz2[j].x);
            float topY = (m1*(ranX-horiz2[j].x)) + horiz2[j].y;
 
            float m2 = (horiz[j+1].y - horiz[j].y) / (horiz[j+1].x - horiz[j].x);
            float bottomY1 = (m2*(ranX2-horiz[j].x)) + horiz[j].y;
            float bottomY2 = (m2*(ranX3-horiz[j].x)) + horiz[j].y;
            triangle(ranX, topY, ranX2, bottomY1, ranX3, bottomY2);
 
          }
         }
       }
 
         println();
       //Switch up horiz and horiz2
       horiz2 = horiz;
       horiz = new PVector[9];
 
    }
 
}

Nick Inzucchi – FaceOSC

by nick @ 2:25 am

Good Evening

I used FaceOSC to generate behavioral portraits of four presidents delivering dire addresses to the American people. Scan-lines represents the facial features of Obama following the BP oil spill, G.W. Bush responding to 9/11, Clinton apologizing for lying to congress, and G.H.W. Bush announcing the invasion of Kuwait. Each president has lines describing the X-Y motion of the eyebrows, eyes, nose, mouth, and jaw over time. I was interested in the particular gaze they adopt staring straight out into the lens. I played with different kinds of digital mark-making until settling on the small vectors above, finishing the whole piece in Photoshop to give a dire EKG-like effect.

EvanSheehan-FaceOSC

by Evan @ 2:09 am

Facial System

[vimeo=http://vimeo.com/35555418]

I used the data from FaceOSC to generate a simulation of a planetary system. The idea is that everyone’s face should generate a slightly different planetary system. Often the orbits are not stable, so you can watch one of your eyes or your mouth slingshot around the sun and achieve escape velocity.

Each planet represents a facial feature, such as an eye, or eyebrow, or mouth. The masses of the planets as well as their distance from the sun are based on the distances of those features as measured by FaceOSC. Initial velocities of each planet are based on the face’s preliminary orientation, and the view translates and scales with the face; so you can get a closer look at your solar system by moving closer to the camera.

Source code on GitHub.

Heather Knight – Face OSC

by heather @ 2:05 am

An antagonistic photon-cannon whose main directive is to cause damage to your eyesight.

[vimeo=http://vimeo.com/35554377]

Please enjoy my audio description. In a department where 50% of our funding comes from the military and some of our most exciting innovations are in the war zones, I decided to use FaceOSC to attack our own citizens. Technology can be used for good or evil, for suspicious or silly. Several of our drones have recently been reassigned from the Middle Easy to domestic skies in the name of law and order. Opensource software could easily bootstrap the development of creatively nefarious systems. Vigilance.

At first, I though I’d build this for real, using servo-motors to hone in on human faces and laser pointers to threaten mild damage. Then I fell victim to the playfulness of particle systems. The logo for this project would be a bullseye with a winking orb at the center, complete with luscious lashes.

Jonathan-13-9-65

by jonathan @ 1:49 am

I kind of approached this part of a project in a different way. Instead of trying to come up with an algorithm to derive the art piece, I decided to turn it into one derived from the user through the use of sound. Though it’s obviously not perfect and is missing a few vital components, it more or less kind of resembles the original 13/9/65.

import ddf.minim.*;
import ddf.minim.signals.*;
import ddf.minim.analysis.*;
import ddf.minim.effects.*;
 
Minim minim;
AudioInput in;
 
int  y, barMic, micIn, count;
float x;
 
ArrayList underLine;
 
void setup() {
 
  size(400, 400);
  // underLine = new ArrayList();
  background(0);
  x = 0;
  y = 40;
  count = 0;
  minim = new Minim(this);
  in = minim.getLineIn(Minim.STEREO, 512);
}
 
void draw() {
 
  noFill();
  strokeWeight(1);
  stroke(255);
  rectMode(CENTER);
  smooth();
  followLine();
  create();
  println(micIn);
  frameRate(60);
}
 
void followLine() {
 
//initialize mic input
 
  for (int i = 0; i  width) {
      x = 0;
      y = y+40;
 
      if (y > height) {
        y = 0;
        x = 0;
      }
    }
  }
}
 
void create() {
 
  //float [] underLine = new float [500];
 
  stroke(0); 
 
  if (micIn > 200) {
 
    ellipse(x, y, micIn/5, micIn/5);
  } 
 
  if (micIn > 15 && micIn  50 && micIn < 90) {
    line(x+random(-20, 20), y-20, x+random(-20, 20), y+20);
  }

Jonathan – Face OSC

by jonathan @ 1:48 am

I wanted to have a little fun with this part of Project 1. I took a quick picture of my friend Ethan, and used his image as the little avatar in my game. My aim of this program was to just get a bit familiar with how OSC functions as well as how the library Face OSC works. The object of the game is to catch the little balls in Ethan’s mouth controlled by the movements of your own mouth. Though this interaction is nothing special, my mental image of people’s opening and closing mouths while sitting at their computer completely engrossed with the game was especially comical, which in the end was a good enough reason for me to make it. Overall the face tracking was surprisingly accurate and held calibration pretty easily, to my surprise. I had expected many more hiccups along the way, but was quite pleasantly surprised not to run into nothing I couldn’t easily troubleshoot myself. What I am looking forward is to keep challenging myself and to keep exploring various modes of interactions.

import oscP5.*;
import netP5.*;
 
float poseScale;
PVector posePosition = new PVector();
PVector poseOrientation = new PVector();
 
OscP5 oscP5;
 
int found, x, y, ellipseSize, score;
float mouthHeight, mouthWidth, totalMouthHeightB, totalMouthHeightT;
PImage eT, eB;
 
void setup() {
  size(640, 480);
  background(255);
 
  eT = loadImage("ethantop.jpg");
  eB = loadImage("ethanbottom.jpg");
  x = 0;
  y = int(random(1, 10));
  score = 0;
  ellipseSize = int(random(20, 50));
  oscP5 = new OscP5(this, 8338);
  oscP5.plug(this, "found", "/found");
  oscP5.plug(this, "poseScale", "/pose/scale");
  oscP5.plug(this, "posePosition", "/pose/position");
  oscP5.plug(this, "poseOrientation", "/pose/orientation");
  oscP5.plug(this, "mouthWidthReceived", "/gesture/mouth/width");
  oscP5.plug(this, "mouthHeightReceived", "/gesture/mouth/height");
  oscP5.plug(this, "eyeLeftReceived", "/gesture/eye/left");
  oscP5.plug(this, "eyeRightReceived", "/gesture/eye/right");
  oscP5.plug(this, "eyebrowLeftReceived", "/gesture/eyebrow/left");
  oscP5.plug(this, "eyebrowRightReceived", "/gesture/eyebrow/right");
  oscP5.plug(this, "jawReceived", "/gesture/jaw");
  oscP5.plug(this, "nostrilsReceived", "/gesture/nostrils");
}
 
void draw() {
  background(255);
  smooth();
  totalMouthHeightB = 22+mouthHeight;
  totalMouthHeightT = -mouthHeight*4;
 
  flyingObjects();
  eating();
}
 
void eating() {
  if (found > 0) {
    //draw image
    image(eB, 0+posePosition.x, posePosition.y-100+totalMouthHeightB, eB.width/12, eB.height/12);
    image(eT, 8+posePosition.x, posePosition.y-100+totalMouthHeightT, eT.width/12, eT.height/12);
  }
}
 
void flyingObjects() {
  x = x + int(random(1, 10));
  fill(random(255), random(255), random(255));
  noStroke();
  //println(y);
  ellipseMode(CENTER);
  //draw balls
  ellipse(x, y, ellipseSize, ellipseSize);
  //check for border
  if (x > width) {
    x = 0;
    y = int(random(height/2));
    ellipseSize = int(random(20, 30));
  }
  //check for hit
  if (y > posePosition.y-100+totalMouthHeightT && y  posePosition.x - 1 && x < posePosition.x + 2 ) {
    x = 0;
    score = score+1;
    y = int(random(height/2));
    ellipseSize = int(random(20, 30));
    background (255, 0, 0);
    //println("hit");
  }
 
  //score
  textSize(100);
  fill(0);
  text(score, width-110, 100);
  println(score);
}
 
public void found(int i) {
  println("found: " + i);
  found = i;
}
 
public void posePosition(float x, float y) {
  println("pose position\tX: " + x + " Y: " + y );
  posePosition.set(x, y, 0);
}
 
public void mouthWidthReceived(float w) {
  println("mouth Width: " + w);
  mouthWidth = w;
}
 
public void mouthHeightReceived(float h) {
  println("mouth height: " + h);
  mouthHeight = h;
}

BillyKeyes-13-9-65

by Billy @ 1:23 am

Press SPACE to generate a new image.

/**
 * 13/9/65 on 23/1/12 
 *
 * Interactive Art and Computational Design
 * Billy Keyes, 2012
 * 
 * A generator of images similar to "13/9/65 Nr. 2" by Frieder Nake
 */
 
final int NUM_LINES = 9;
final int SEGMENTS = 6;
 
ArrayList lines;
 
void setup() {
  size(650, 650);
  smooth();
  noLoop();
 
  stroke(0);
  strokeWeight(1.25);
 
  lines = new ArrayList(NUM_LINES + 2);
}
 
void draw() {
  background(240);
 
  // Draw horizontal lines
  lines.add(drawSegmentedLine(SEGMENTS, 50, 0, 0));
  for (int i = 1; i < NUM_LINES; i++) {
    lines.add(drawSegmentedLine(SEGMENTS, 50, i * height / NUM_LINES, 40)); 
  }
  lines.add(drawSegmentedLine(SEGMENTS, 50, height, 0));
 
  // Draw vertical "connecting" lines
  for (int i = 0; i < lines.size() - 1; i++) {
    float[][] t = lines.get(i);
    float[][] b = lines.get(i+1);
    // Prefer higher numbers of connections between two given rows
    int connections = int(sqrt(random(1, 49)));
    for (int j = 0; j < connections; j++) {
      // Choose a segment to connect
      int seg = int(random(SEGMENTS));
      if (random(1) < 0.5) {
        drawStraightConnectingLines(new float[][]{t[seg], t[seg+1]}, 
                                    new float[][]{b[seg], b[seg+1]},
                                    int(random(3, 9)), random(0.2, 0.6), random(0.25, 1.0));
      } else {
        drawDiagConnectingLines(new float[][]{t[seg], t[seg+1]}, 
                                new float[][]{b[seg], b[seg+1]},
                                int(random(3, 9)), random(0.2, 0.6));
      }
    }
  }
 
  // Draw circles
  ellipseMode(CENTER);
  noFill();
  for (int i = 0; i < NUM_LINES; i++) {
    for (int j = 0; j < SEGMENTS; j++) {
      if (random(1) < 0.1) {
         float hf = (float) height;
         float wf = (float) width;
         float side = sqrt(random(16, sq(hf / (NUM_LINES - 3))));
         ellipse(wobble(wf / (SEGMENTS * 2) + j * wf / SEGMENTS, wf / SEGMENTS),
                 wobble(hf / (NUM_LINES * 2) + i * hf / NUM_LINES, hf / NUM_LINES),
                 side, side);
      }
    }
  }
}
 
 
/**
 * @param segs  The number of segments to draw
 * @param dx    The amount of x variation in segment endpoints
 * @param y     The base y coordinate of segment endpoints
 * @param dy    The amount of y variation in segment endpoints
 */
float[][] drawSegmentedLine(int segs, float dx, float y, float dy) {
  float[][] points = new float[segs + 1][2];
  points[0][0] = 0;
  points[0][1] = wobble(y, dy);
 
  for (int i = 1; i <= segs; i++) {
    points[i][0] = (i == segs) ? width : wobble(i * width / segs, dx);
    points[i][1] = wobble(y, dy);
    line(points[i - 1][0], points[i - 1][1], points[i][0], points[i][1]);
  }
  return points;
}
 
 
/**
 * @param top       The top set of segments
 * @param bottom    The bottom set of segments
 * @param density   Approximately the number of clusters to draw
 * @param cluster   Influences how many lines are in each cluster (greater than 0.25)
 * @param spread    How much of the segment is filled with lines (between 0.0 and 1.0)
 */
void drawStraightConnectingLines(float[][] top, float[][] bottom, int density, float cluster, float spread) {
  for (int i = 0; i < top.length; i += 2) {
    float xl = max(top[i][0], bottom[i][0]);
    float xr = min(top[i+1][0], bottom[i+1][0]);
    float diff = spread * (xr - xl);
    float base = random(xl, xr - diff);
 
    density = density + int(random(0, 2));
    for (int j = 1; j < density; j++) {
      for (int k = 0; k < cluster * 4; k++) {
        float x = base + wobble(j * diff / density, cluster * diff / density);
        float yt = ylerp(top, i, x);
        float yb = ylerp(bottom, i, x);
        line(x, yt, x, yb);
      }
    }
  }
}
 
 
/**
 * @param top       The top set of segments
 * @param bottom    The bottom set of segments
 * @param density   Approximately the number of clusters to draw
 * @param cluster   Influences how many lines are in each cluster (greater than 0.25)
 */
void drawDiagConnectingLines(float[][] top, float[][] bottom, int density, float cluster) {
  for (int i = 0; i < top.length; i += 2) {
    float[][] src, dest;
    if (random(1) < 0.5) {
      src = top;
      dest = bottom;
    } else {
      src = bottom;
      dest = top;
    }
 
    float diff = src[i+1][0] - src[i][0];
    density = density + int(random(0, 2));
    for (int j = 1; j < density; j++) {
      for (int k = 0; k < cluster * 4; k++) {
        float xs = src[i][0] + wobble(j * diff / density, cluster * diff / (density + 1));
        float xd = random(dest[i][0], dest[i+1][0]);
        float ys = ylerp(src, i, xs);
        float yd = ylerp(dest, i, xd);
        line(xs, ys, xd, yd);
      }
    }
  }
}
 
 
/**
 * Produces a random value at most dv/2 away from the given value.
 */
float wobble(float v, float dv) {
  return v + random(-dv / 2, dv / 2);
}
 
 
/**
 * Linear interpolation to find the y coordinate on the degment for the
 * given x coordinate.
*/ 
float ylerp(float[][] points, int i, float x) {
  return lerp(points[i][1], points[i+1][1], (x - points[i][0]) / (points[i+1][0] - points[i][0])); 
}
 
 
void keyPressed() {
  if (key == ' ') {
    lines.clear();
    redraw();
  }
}

Download (PDF, 17KB)

CraigFahner-FaceOSC

by craig @ 1:00 am

[youtube=http://www.youtube.com/watch?v=iDYR3JWxDqo]

For the FaceOSC project, I decided to focus one one gesture in particular: blinking eyes. I was thinking about Walter Murch’s book “In The Blink of an Eye”. Murch was a film editor. He argues that the blink of an eye is a means for our minds to delineate experience, to punctuate our perception. The job of a film editor is, too, to delineate experience, and it’s no surprise that film audiences have been observed to blink in tandem, synchronizing with the editor’s cuts. I thought it would be interesting to force my perception of experience on a viewer by projecting my blink into the space around me. I used FaceOSC, Max/MSP and Arduino to wire the lights in my studio up to turn off each time I blink. The effect is that the entire space goes dark whenever I blink. While this is barely perceptible to me, the viewer gets to experience the same delineations of time that I do. Perhaps blinks are like sneezes – maybe they are contagious.

CraigFahner-13-9-65

by craig @ 12:48 am

Processing Code

size(600, 600);
smooth();
strokeWeight(2);
background(255);
int[] yLines = new int[9];
int[] yVariations = new int[8];
int[] xVariations = new int[8];
int[] xSteps = new int[8];
int[] ySteps = new int[8];
int[][] xCoord = new int[9][8];
int[][] yCoord = new int[9][8];
int xCumulative = 0;
int yCumulative = 0;
 
 
//draw bounding box
line(0, 0, 0, width-1);
line(0, 0, width-1, 0);
line(width-1, 0, width-1, width-1);
line(0, width-1, width-1, width-1);
 
// determine distance between horizontal lines
for (int i = 0; i<9; i++) {
  yLines[i] = int(random(40, 90));
}
 
//draw horizontal lines
for (int q=0; q<9; q++) {
 
  yCumulative = yCumulative + yLines[q];
  for (int n = 0; n<8; n++) {
    yVariations[n] = int(random(-20, 20));
    xVariations[n] = int(random(60, 110));
    xCumulative = xCumulative+xVariations[n];
    xSteps[n] = xCumulative;
    println(xCumulative);
  }
  xCoord[q][0]=0;
  yCoord[q][0]=yCumulative;
  xCoord[q][1]=xSteps[0];
  yCoord[q][1]=yCumulative+yVariations[0];
  line(xCoord[q][0], yCoord[q][0], xCoord[q][1], yCoord[q][1]);
  for (int z = 0; z<5; z++) {
    xCoord[q][z+1]=xSteps[z];
    yCoord[q][z+1]=yCumulative+yVariations[z];
    line(xSteps[z], yCumulative+yVariations[z], xSteps[z+1], yCumulative+yVariations[z+1]);
  }
  xCoord[q][6]=xSteps[5];
  yCoord[q][6]=yCumulative+yVariations[5];
  xCoord[q][7]=width;
  yCoord[q][7]=yCumulative+yVariations[6];
  line(xSteps[5], yCumulative+yVariations[5], width, yCumulative+yVariations[6]);
  xCumulative = 0;
}
 
 
//draw vertical lines
for (int c = 0; c<8; c++) {
  for (int i = 0; i<7; i++) {
    int rando1 = int(random(4));
    if (rando1 == 1) {
      for (int d = 0; d<18; d++) {
        int vx1 = int(random(xCoord[c][i], xCoord[c][i+1]));
        int vx2 = 0;
        if (xCoord[c+1][i]  xCoord[c][i+1]) {
          vx2 = vx1;
        } 
        else {
          vx2 = int(random(xCoord[c+1][i], xCoord[c+1][i+1]));
        }
        int vy1 = int(map(vx1, xCoord[c][i], xCoord[c][i+1], yCoord[c][i], yCoord[c][i+1]));
        int vy2 = int(map(vx2, xCoord[c+1][i], xCoord[c+1][i+1], yCoord[c+1][i], yCoord[c+1][i+1]));
        line(vx1, vy1, vx2, vy2);
      }
    }
  }
}
 
 
//draw circles
int rando2 = int(random(5, 10));
 
for (int i = 0; i<rando2; i++) {
  fill(0, 0, 0, 0);
  int diam = int(random(4, 120));
  ellipse(random(0, width), random(0, width), diam, diam);
}
« Previous PageNext Page »
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
(c) 2024 Interactive Art and Computational Design, Spring 2012 | powered by WordPress with Barecity