import oscP5.*;
import netP5.*;
class kinectReceiver {
OscP5 theOscP5;
NetAddress myRemoteLocation;
public int lefthand_x;
public int lefthand_y;
public String addrPattern;
public String typeTag;
kinectReceiver(String theIP, int thePort) {
try {
theOscP5 = new OscP5(this, theIP, thePort);
myRemoteLocation = new NetAddress(theIP, thePort);
}
catch (Exception e)
{
println("there's probably something wrong with the format of the IP or the Port:" + e.getMessage());
}
}
void oscEvent(OscMessage theOscMessage) {
addrPattern = theOscMessage.addrPattern();
typeTag = theOscMessage.typetag();
if (theOscMessage.checkAddrPattern("/kinect/linkehand")) {
if (theOscMessage.checkTypetag("ii")) {
lefthand_x = theOscMessage.get(0).intValue();
lefthand_y = theOscMessage.get(1).intValue();
}
else {println("Wrong typetag received!");}
}
}
kinectReceiver myReceiver;
void setup(){
size(250,250);
background(255);
myReceiver = new kinectReceiver("127.0.0.1",7001);
}
void draw(){
println("TypeTag: " + myReceiver.typeTag);
println("addrPattern: " + myReceiver.addrPattern);
// println("linke Hand: " + myReceiver.lefthand_x + " " + myReceiver.lefthand_y);