Presence
Presence was an interactive installation that visualized the ebb and flow of people at the SVA IxD studio.
A physical button placed at the entrance way, inviting arrivers to simply push the + button to add a node to the geometric shape projected on the wall. And upon exiting, to push the – button to remove a node.
The projection speaks to how each person's presence has an impact on the living, changing shape of a larger community.
Presence was a collaboration with Matt Brigante and Melody Quintana.
Code on our arduino side:
//Define constant pins const int red = 5; const int ledPinR = 13; //Variables will change int ledStateR = HIGH; // the current state of the LED Pin 13 int buttonStateR; // the current reading from input pin 5 int lastButtonStateR = LOW; // the previous reading from input pin 5 long lastDebounceTimeR = 0; // the last time LED Pin 13 was toggled long debounceDelayR = 50; // the debounce time const int black = 6; const int ledPinB = 11; int ledStateB = LOW; int buttonStateB; int lastButtonStateB = HIGH; long lastDebounceTimeB = 0; long debounceDelayB = 50; void setup() { Serial.begin(9600); pinMode(red,INPUT); pinMode(ledPinR, OUTPUT); digitalWrite(ledPinR,ledStateR); // set initial LED state pinMode(black,INPUT); pinMode(ledPinB, OUTPUT); digitalWrite(ledPinB,ledStateB); } void loop() { //Read the state of the switch into a local variable int redVal = digitalRead(red); int blkVal = digitalRead(black); //if the red button changed, due to noise or pressing if (redVal != lastButtonStateR) { // reset the debouncing timer lastDebounceTimeR = millis(); } if (blkVal != lastButtonStateB) { lastDebounceTimeB = millis(); } if ((millis() - lastDebounceTimeR) > debounceDelayR) { // whatever the reading is at, //it's been there for longer than the debounce delay, //so take it as the actual current state //if the red button state has changed if(redVal != buttonStateR) { buttonStateR = redVal; //only toggle the LED if the new button state is HIGH if (buttonStateR == HIGH) { ledStateR = !ledStateR; Serial.println(redVal); } } } if ((millis() - lastDebounceTimeB) > debounceDelayB) { if(blkVal != buttonStateB) { buttonStateB = blkVal; if (buttonStateB == LOW) { ledStateB = !ledStateB; Serial.println(blkVal); } } } //set the LED digitalWrite(ledPinR, ledStateR); //save the reading. next time through the loop //it'll be the lastButtonStateR lastButtonStateR = redVal; digitalWrite(ledPinB, ledStateB); lastButtonStateB = blkVal; }
Code on our processing side:
//IMPORT LIBRARIES import quickhull3d.*; import ComputationalGeometry.*; import processing.serial.*; //DECLARE OBJECTS & VARIABLES Serial myPort; String data; //IsoWrap wrap; Wrapper wrap; int currentNodes; int nodesIncrease; int nodesDecrease; int arduinoVal; int currentColor; void setup() { currentNodes = 4; //set current number of nodes to starting number nodesIncrease = 1; //how much current nodes will increase when the button is pressed nodesDecrease = 1; currentColor = 255; size(1300, 900, P3D); //println(Serial.list()); String portName = Serial.list()[9]; //change the 0 to a 1 or 2 etc. to match your port myPort = new Serial(this, portName, 9600); myPort.bufferUntil('\n'); //Construct the iso wrap wrap = new Wrapper(this); // Add points for (int i=0; i<currentNodes; i++) { wrap.addPt( new PVector(random(-100, 100), random(-100, 100), random(-100, 100) ) ); } } void draw() { smooth(); background(0); lights(); float zm = 250; float sp = 0.01 * frameCount; camera(zm * cos(sp), zm * sin(sp), zm, 0, 0, 0, 0, 0, -1); stroke(currentColor); strokeWeight(1); noFill(); wrap.plot(); } void serialEvent(Serial p) { String inString = p.readString(); inString = trim(inString); arduinoVal = int(inString); println(arduinoVal); PVector v; v = new PVector(random(-100, 100), random(-100, 100), random(-100, 100) ); if (arduinoVal == 1){ currentNodes+= 1; println(currentNodes); addNode(); changeColor(); } else if (arduinoVal == 0){ currentNodes-= 1; println(currentNodes); subtractNode(); changeColor(); } } void addNode(){ PVector v = new PVector(random(-100, 100), random(-100, 100), random(-100, 100) ); wrap.addPt(v); } void subtractNode(){ wrap.removePt((int)random(0,wrap.ptset.size())); } void changeColor(){ if (currentNodes == 5){ currentColor = 100; } if (currentNodes == 6){ currentColor = 255; } if (currentNodes == 7){ currentColor = 150; } if (currentNodes == 8){ currentColor = 255; } if (currentNodes == 9){ currentColor = 100; } if (currentNodes == 10){ currentColor = 255; } if (currentNodes == 11){ currentColor = 150; } if (currentNodes == 12){ currentColor = 255; } if (currentNodes == 13){ currentColor = 100; } if (currentNodes == 14){ currentColor = 255; } if (currentNodes == 15){ currentColor = 150; } if (currentNodes == 16){ currentColor = 255; } if (currentNodes == 17){ currentColor = 100; } if (currentNodes == 18){ currentColor = 255; } if (currentNodes == 19){ currentColor = 150; } if (currentNodes == 20){ currentColor = 255; } if (currentNodes == 21){ currentColor = 100; } if (currentNodes == 22){ currentColor = 255; } if (currentNodes == 23){ currentColor = 150; } if (currentNodes == 24){ currentColor = 255; } if (currentNodes == 25){ currentColor = 100; } if (currentNodes == 26){ currentColor = 255; } if (currentNodes == 27){ currentColor = 150; } if (currentNodes == 28){ currentColor = 255; } if (currentNodes == 29){ currentColor = 100; } if (currentNodes == 30){ currentColor = 255; } if (currentNodes == 31){ currentColor = 150; } if (currentNodes == 32){ currentColor = 255; } if (currentNodes == 33){ currentColor = 100; } if (currentNodes == 34){ currentColor = 255; } if (currentNodes == 35){ currentColor = 150; } if (currentNodes == 36){ currentColor = 255; } if (currentNodes == 37){ currentColor = 100; } if (currentNodes == 38){ currentColor = 255; } if (currentNodes == 39){ currentColor = 150; } if (currentNodes == 40){ currentColor = 255; } if (currentNodes == 41){ currentColor = 100; } if (currentNodes == 42){ currentColor = 255; } if (currentNodes == 43){ currentColor = 150; } if (currentNodes == 44){ currentColor = 255; } if (currentNodes == 45){ currentColor = 100; } if (currentNodes == 46){ currentColor = 255; } if (currentNodes == 47){ currentColor = 150; } if (currentNodes == 48){ currentColor = 255; } if (currentNodes == 49){ currentColor = 100; } if (currentNodes == 50){ currentColor = 255; } if (currentNodes == 51){ currentColor = 150; } if (currentNodes == 52){ currentColor = 255; } if (currentNodes == 53){ currentColor = 100; } if (currentNodes == 54){ currentColor = 255; } if (currentNodes == 55){ currentColor = 150; } if (currentNodes == 56){ currentColor = 255; } if (currentNodes == 57){ currentColor = 100; } if (currentNodes == 58){ currentColor = 255; } if (currentNodes == 59){ currentColor = 150; } if (currentNodes == 60){ currentColor = 255; } if (currentNodes == 61){ currentColor = 100; } if (currentNodes == 62){ currentColor = 255; } if (currentNodes == 63){ currentColor = 150; } if (currentNodes == 64){ currentColor = 255; } if (currentNodes == 65){ currentColor = 100; } if (currentNodes == 66){ currentColor = 255; } if (currentNodes == 67){ currentColor = 150; } if (currentNodes == 68){ currentColor = 255; } if (currentNodes == 69){ currentColor = 100; } if (currentNodes == 70){ currentColor = 255; } if (currentNodes == 71){ currentColor = 150; } if (currentNodes == 72){ currentColor = 255; } if (currentNodes == 73){ currentColor = 100; } if (currentNodes == 74){ currentColor = 255; } if (currentNodes == 75){ currentColor = 150; } if (currentNodes == 76){ currentColor = 255; } if (currentNodes == 77){ currentColor = 100; } if (currentNodes == 78){ currentColor = 255; } if (currentNodes == 79){ currentColor = 150; } if (currentNodes == 80){ currentColor = 255; } if (currentNodes == 81){ currentColor = 100; } if (currentNodes == 82){ currentColor = 255; } if (currentNodes == 83){ currentColor = 150; } if (currentNodes == 84){ currentColor = 255; } }
Wrapper class code:
import processing.core.*; import quickhull3d.*; public class Wrapper implements PConstants{ PApplet theParent; ArrayList ptset; QuickHull3D hull; public Wrapper(PApplet _theParent) { theParent = _theParent; ptset = new ArrayList(); hull = new QuickHull3D(); } //---------------------------------------------------------------------------------------- public void addPt(PVector pt) { Point3d temp = new Point3d(pt.x, pt.y, pt.z); ptset.add(temp); } public void removePt(int index){ ptset.remove(index); } //---------------------------------------------------------------------------------------- public void addPts(PVector[] pts) { for (int i = 0; i < pts.length; i++) { Point3d temp = new Point3d(pts[i].x, pts[i].y, pts[i].z); ptset.add(temp); } } //---------------------------------------------------------------------------------------- public void plot() { Point3d[] set = new Point3d[ptset.size()]; for(int i=0;i<ptset.size();i++){ set[i] = (Point3d)ptset.get(i); } hull.build (set); Point3d[] vertices = hull.getVertices(); int[][] faceIndices = hull.getFaces(); for (int i = 0; i < faceIndices.length; i++) { theParent.beginShape(); for (int k = 0; k < faceIndices[i].length; k++) { Point3d v = vertices[faceIndices[i][k]]; theParent.vertex((float)v.x, (float)v.y, (float)v.z); } theParent.endShape(CLOSE); } } }











