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(); } } }
void update(){ numButton = joy.getButtonNum(); valueButton = joy.getButtonValue(); numAxis = joy.getAxisNum(); valueAxis = joy.getAxisValue(); switch(numButton){ case 7: //left x--; break; case 5: //right x++; break; case 4: //up y--; break; case 6: //down y++; break; } numButton = 0; box.setPosition(ofVec3f(x,y,0)); print(); }