ocannoli-Body

Star Collector

Move your face to direct the telescope (the blue circle) to the special yellow stars. Once a star is in your sights, open your mouth to collect it and get a point. But be careful not to raise your eyebrows too high or the aliens will attack and take your points.

Going into this project, brainstorming for ideas was difficult for me. I had a lot of shallow, surface level ideas but no a lot of concepts I thought were good enough. A lot of my process started conceptually with an idea of the project or the narrative rather than understanding the full relationship with the body; therefore, I never fully landed on something I thought was interesting or in depth enough. For the star collector idea I liked the idea of the the ability for the body or even simply the face to control space or the cosmos. I wanted to add more features and a different style which would limit the players view to just that circle and have the board be much bigger. I also wanted players to find patterns, or maybe constellations rather than other "stars".  I used face OSC in processing which was both an intentional move but also somewhat guided the relationship between the body and the interface. Overall, I enjoyed the experience of working with motion capture for the first time and if I were to redo this project I'd like to come up with something more complex either conceptually or in execution.

 //
// a template for receiving face tracking osc messages from
// Kyle McDonald's FaceOSC https://github.com/kylemcdonald/ofxFaceTracker
//
// 2012 Dan Wilcox danomatika.com
// for the IACD Spring 2012 class at the CMU School of Art
//
// adapted from from Greg Borenstein's 2011 example
// http://www.gregborenstein.com/
// https://gist.github.com/1603230
//
import oscP5.*;
OscP5 oscP5;
 
// num faces found
int found;
 
// pose
float poseScale;
PVector posePosition = new PVector();
PVector poseOrientation = new PVector();
 
// gesture
float mouthHeight;
float mouthWidth;
float eyeLeft;
float eyeRight;
float eyebrowLeft;
float eyebrowRight;
float jaw;
float nostrils;
float circleX;
float circleY; 
PImage starSky;
PImage aliens; 
int score; 
FloatList specialStars;
PFont fjFont;
int numOfStars; 
boolean doneOnce;
 
 
 
void setup() {
  size(800, 800);
  frameRate(30);
 
  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");
  starSky = loadImage("stars.png");
  aliens= loadImage("ALIENS.png");
  score=0; 
  specialStars = new FloatList();
  numOfStars=7;
  for (int i=0; i<numOfStars;i++){ createSpecialStar(); } fjFont = createFont("FjallaOne-Regular.ttf",32); doneOnce=false; } public void createSpecialStar(){ float x= random(0,width); float y=random(85,height-180); specialStars.append(x); specialStars.append(y); } public void newSpecialStars(){ for (int i=specialStars.size()-1;i>-1; i--){
     specialStars.remove(i);
   }
   for (int i=0; i<numOfStars; i++){
     createSpecialStar(); 
   }
 }
 
void draw() {  
  image(starSky,0,0);
  int seconds = second();
  //refreshes special stars every 5 seconds
  if ((seconds-1)%5==0 && doneOnce==true){
    doneOnce=false; 
  }
  if (seconds%5==0 &&doneOnce==false){
    newSpecialStars(); 
    doneOnce=true; 
 
  }
  //tint(255,255,255); 
  float radius=40; 
  textFont(fjFont);
  textSize(50); 
  text("Score: "+score,10,height-10); 
  fill(255,255,102);
  noStroke(); 
  //makes special stars
  for (int i=0; i<specialStars.size(); i+=2){
    float starX=specialStars.get(i);
    float starY=specialStars.get(i+1);
    ellipse(starX, starY, 10,10);   
  }
 
  //Makes telescope Circle
  stroke(0);
  noFill(); 
  stroke(204,229,255);
  strokeWeight(4);
  ellipse(circleX,circleY,radius*2,radius*2); 
 
  for (int i=0; i<specialStars.size(); i+=2){
    float starX=specialStars.get(i);
    float starY=specialStars.get(i+1);
    //makes stars then checks valid to eat star
    if (starX<circleX+(radius/2) && starX>circleX-(radius/2) && starY<circleY+(radius/2) && starY>circleY-(radius/2)){ 
        if(jaw>23.5){
          specialStars.remove(i+1);
          specialStars.remove(i);
          score+=1; 
          createSpecialStar(); 
        }
 
    }
  }
 
  if (eyebrowLeft>9.2){
    image(aliens,width/6,height/4,592,326.5);
    if (score<=5){ score=0; } else if (score>5){
      score=score-5; 
    }
  }
 
}
 
 
 
// OSC CALLBACK FUNCTIONS
 
public void found(int i) {
  println("found: " + i);
  found = i;
}
 
public void poseScale(float s) {
  println("scale: " + s);
  poseScale = s;
}
 
public void posePosition(float x, float y) {
  println("pose position\tX: " + x + " Y: " + y );
  posePosition.set(x, y, 0);
  circleX=x+(posePosition.x-150);
  circleY=y+(posePosition.y-150);
 
 
}
 
public void poseOrientation(float x, float y, float z) {
  println("pose orientation\tX: " + x + " Y: " + y + " Z: " + z);
  poseOrientation.set(x, y, z);
}
 
public void mouthWidthReceived(float w) {
  println("mouth Width: " + w);
  mouthWidth = w;
}
 
public void mouthHeightReceived(float h) {
  println("mouth height: " + h);
  mouthHeight = h;
}
 
public void eyeLeftReceived(float f) {
  println("eye left: " + f);
  eyeLeft = f;
}
 
public void eyeRightReceived(float f) {
  println("eye right: " + f);
  eyeRight = f;
}
 
public void eyebrowLeftReceived(float f) {
  println("eyebrow left: " + f);
  eyebrowLeft = f;
}
 
public void eyebrowRightReceived(float f) {
  println("eyebrow right: " + f);
  eyebrowRight = f;
}
 
public void jawReceived(float f) {
  println("jaw: " + f);
  jaw = f;
}
 
public void nostrilsReceived(float f) {
  println("nostrils: " + f);
  nostrils = f;
}
 
// all other OSC messages end up here
void oscEvent(OscMessage m) {
  if(m.isPlugged() == false) {
    println("UNPLUGGED: " + m);
  }
}