Permalink
Browse files

Rework of psmove 270 grades, this shit fucking work

  • Loading branch information...
almul0 committed Jan 12, 2018
1 parent b32f326 commit fc0ae7a239d63d1055dd5032f19fd47cf598cc8e
View
BIN -61.1 KB (43%) bin/data/assets/front.jpg
Binary file not shown.
View
BIN -66.9 KB (42%) bin/data/assets/left.jpg
Binary file not shown.
View
BIN -77.7 KB (36%) bin/data/assets/reveal.png
Binary file not shown.
View
BIN -53 KB (42%) bin/data/assets/right.jpg
Binary file not shown.
View
@@ -4,7 +4,7 @@
//========================================================================
int main( ){
ofSetupOpenGL( 1024,768, OF_WINDOW); // <-------- setup the GL context
ofSetupOpenGL( 1920,480, OF_WINDOW); // <-------- setup the GL context
// this kicks off the running of my app
// can be OF_WINDOW or OF_FULLSCREEN
View
@@ -5,6 +5,9 @@ void ofApp::setup(){
psMoveReceiver.setup();
ofxAddPSMoveListeners(this);
left.load("./assets/left.jpg");
front.load("./assets/front.jpg");
right.load("./assets/right.jpg");
lantern.load("./assets/reveal.png");
}
@@ -22,7 +25,9 @@ void ofApp::update(ofEventArgs & args) {
void ofApp::draw(){
ofEnableAlphaBlending();
right.draw(0,0);
left.draw(0, 0);
front.draw(640, 0);
right.draw(1280,0);
lantern.draw(cursor.x-(lantern.getWidth()/2),cursor.y-(lantern.getHeight()/2));
ofDisableAlphaBlending();
}
@@ -177,11 +182,9 @@ void ofApp::onPSMoved( ofxPSMove::EventArgs & psmoveEvent )
psmoveEvent.data->position.y,
psmoveEvent.data->position.z);*/
cursor.x = psmoveEvent.data->position.x;
cursor.y = psmoveEvent.data->position.y;
}
void ofApp::exit() {
}
View
@@ -25,6 +25,8 @@ class ofApp : public ofBaseApp{
void gotMessage(ofMessage msg);
ofxPSMove::Receiver psMoveReceiver;
ofImage left;
ofImage front;
ofImage right;
ofImage lantern;
ofPoint cursor;
View
@@ -13,7 +13,7 @@ namespace ofxPSMove {
ofVec3f accelerometer , gyroscope , magnetometer, position;
ofVec4f orientation;
cv::Mat intrinsics;
ofVec3f p11, p12;
ofVec3f pfl, pfr, pl, pr;
bool BTN_TRIANGLE
,BTN_CIRCLE
,BTN_CROSS
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -66,11 +66,14 @@ namespace ofxPSMove {
bool linePlaneIntersection(const cv::Vec3f& n, const cv::Vec3f& c, const cv::Vec3f& x0,
const cv::Vec3f& v, cv::Vec3f& vecIntersection, float& flFraction);
bool getFrontIntersectionPoint(int move_id, float& xi, float& yi, float& zi);
bool getLeftIntersectionPoint(int move_id, float& xi, float& yi, float& zi, cv::Vec3f cl);
bool getRightIntersectionPoint(int move_id, float& xi, float& yi, float& zi, cv::Vec3f cr);
bool getLeftIntersectionPoint(int move_id, float& xi, float& yi, float& zi);
bool getRightIntersectionPoint(int move_id, float& xi, float& yi, float& zi);
void getPositionAndOrientation(int move_id, float& xgl, float& ygl, float& zgl, glm::vec3& direction);
void frontPointToPixel(int id, float x, float y, int& xv, int& yv);
void leftPointToPixel(int id, float x, float y, int& xv, int& yv);
void rightPointToPixel(int id, float x, float y, int& xv, int& yv);
};
};
}
#endif /* defined(__emptyExample__ofxPSMove__) */

0 comments on commit fc0ae7a

Please sign in to comment.