GMU:(In)Visible Networks/Esra Demirel: Difference between revisions

From Medien Wiki
No edit summary
Line 40: Line 40:
   oscP5 = new OscP5(this, 1065);
   oscP5 = new OscP5(this, 1065);
   myRemoteLocation = new NetAddress("141.54.159.160", 1065); // our computer...
   myRemoteLocation = new NetAddress("141.54.159.160", 1065); // our computer...
}void draw() {
  void draw(){
   // periodically ask the captury server to send us data.
   // periodically ask the captury server to send us data.
   if (millis()-lastMillis>5000) {
   if (millis()-lastMillis>5000) {
     // The format is as follows:
     // The format is as follows:
Line 48: Line 47:
     //most of the placeholders can be replaced by a "*" for "everything"
     //most of the placeholders can be replaced by a "*" for "everything"
     // unfortunately, if you subscribe to too many things, a bug in the captury will lead to malformed OSC-bundles that in turn crash OSCP5
     // unfortunately, if you subscribe to too many things, a bug in the captury will lead to malformed OSC-bundles that in turn crash OSCP5
  OscMessage myMessage = new OscMessage("/subscribe/*/blender/Head/vector"); // get positions ("vector") of all joints of actor "felix_braun_rot" in mm
  OscMessage myMessage = new OscMessage("/subscribe/*/blender/Head/vector");  
oscP5.send(myMessage, myRemoteLocation);}
  // get positions ("vector") of all joints of actor "felix_braun_rot" in mm
strokeWeight(4);   
  oscP5.send(myMessage, myRemoteLocation);}
  strokeWeight(4);   
   // go through list of joints and draw them all
   // go through list of joints and draw them all
   frameRate(5);
   frameRate(5);
Line 62: Line 62:
   }
   }
   joints.clear();
   joints.clear();
}
  }
 
  /* incoming osc message are forwarded to the oscEvent method. */
/* incoming osc message are forwarded to the oscEvent method. */
  void oscEvent(OscMessage theOscMessage) {
 
void oscEvent(OscMessage theOscMessage) {
   println(theOscMessage); // debug out
   println(theOscMessage); // debug out
   // only use packages that contain position data as three floats
   // only use packages that contain position data as three floats