Face Controlled Game – FaceOSC/Processing/MaxMsp

by alan_herman @ 2:12 am December 13, 2011

Video Documentation:

Link to Download FaceOSC:
FaceOSC Download URL

Processing Code:

/**
* oscP5parsing by andreas schlegel
* example shows how to parse incoming osc messages "by hand".
* it is recommended to take a look at oscP5plug for an
* alternative and more convenient way to parse messages.
* oscP5 website at http://www.sojamo.de/oscP5
*/
 
import oscP5.*;
import netP5.*;
 
int int0;
int int1;
int int2;
int x1 = 600/2-50;
int y1 = 600/2-50;
boolean won = false;
 
OscP5 oscP5;
NetAddress myRemoteLocation;
 
void setup() {
size(600,600);
frameRate(25);
oscP5 = new OscP5(this,12000);
myRemoteLocation = new NetAddress("127.0.0.1",12000);
}
 
void draw() {
if((Math.abs(x1-int0) < 3) && (Math.abs(int1-60) < 3) || won == true) {
background(255);
rect(600/2-int1,600/2-int0,int1,int1);
won=true;
println("hi");
}
else if(won == false){
background(0);
fill(255);
rect(x1, y1, 60, 60);
fill(255,0,0);
rect(int0, y1, int1, int1);
}
}
 
void oscEvent(OscMessage theOscMessage) {
if(theOscMessage.checkAddrPattern("/number")==true) {
int0 = (int)theOscMessage.get(0).floatValue();
int1 = (int)theOscMessage.get(1).floatValue();
int2 = (int)theOscMessage.get(2).floatValue();
println(int2);
return;
}
}

Max5 Patch:
———-begin_max5_patcher———-
1349.3ocyZt0bhaCE.9YxuBML4oNDhNRVWbeqS+AzG5ic1YGCVAbqwlAL6lr 6r6u8pKFJI0NHGaKXRhYvVXeNem6h786lLcQ4yp8SQ+J5uPSl786lLwdJyIl T+9IS2j77x7j81kMsP80xE+8zYtKUodtxd58KSxUH7bDf0GHlCb8giqq3vlx CU4pJ6MApOaVp8ypueOHiNtT25pdYqxIVSmh9T8kdprnpHYi8BS+scYI4mc+ yJNd64ms78YeytbfLGWe5sIUKWmUr5y6TKqbOCADouLhxMqBAT6KD7bL5SlO yOt6NygY8CQ+xOQPG.BoUfrOaUgV06JVHcFKwLCG3wDGbFEnfHcfIPqL4o7x jpPfDp0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IsIU6AkUjTkUVb 9pLSpe1pVmklpJNuy3MYoaKyJppEiVrddKUlcU5hRkY9MDIXBk8wcQYhETPQ h7kSgSlD9JRP37mLa61k8xeiW23KU7WQg1h8hCqKEyCTIBqHw8PjHg0Km5Cl n7aPYh1sPOhtzCS27BFruHomdWOkVSKZWz6mGVqJ2m5NllvCoLQ7w6OrdZbe p6PBasPSyrW11E1T7Lexb8FA+lnmAVXyvK7w1Y9GOIfxjzm3NyzDArQFgO1N dXaX3MlkaBYh6S+dVCb3rcLgu9SAz14CmDgMOtvqFPCKm3be8mBX9IexEHw2 by9ICaKcRrut3vskLIgvxIe1HHAOrk67IrSD3VU7RlhtAaepOiHneyOt6eQP Gq0D
———–end_max5_patcher———–

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
(c) 2017 CMU Electronic Media Studio II, Fall 2011, Section A | powered by WordPress with Barecity