void setup(){ joy.setup("/dev/input/js0"); if (!joy.isFound()) ofLog()<<"open Failed!"; else ofLog()<<"open Start!"; box.set(100); }
void draw(){ for (int i = 0; i < joints.size(); i++){ if(joints.at(i)->getName() == "Head"){ ofSetColor(255, 100, 100); box.set(20, 20, 20); box.setPosition(joints.at(i+1)->getPosition()); box.draw(); } else if (joints.at(i)->isSite()){ ofSetColor(100, 255, 100); box.set(5, 5, 5); box.setPosition(joints.at(i)->getPosition()); box.draw(); } else { ofSetColor(100, 100, 255); box.set(2, 2 ,2); box.setPosition(joints.at(i)->getPosition()); box.draw(); } } }