Ejemplo n.º 1
0
	void draw(){
		ofEnableDepthTest();
		ofSetColor(255,0,0);
		box.draw();
		ofSetColor(0,0,0);
		box.drawWireframe();
		ofDisableDepthTest();
	}
Ejemplo n.º 2
0
	void setup(){
		joy.setup("/dev/input/js0");
		if (!joy.isFound()) 
		    ofLog()<<"open Failed!";
		else
		    ofLog()<<"open Start!";
		box.set(100);
	}
Ejemplo n.º 3
0
	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();
				}
			}
	}
Ejemplo n.º 4
0
	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();
	}