forked from Albert/ofxPortalCam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathofxPortalCam.h
61 lines (49 loc) · 1.05 KB
/
ofxPortalCam.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#pragma once
/*
* ofxPortalCam.h
* ofxPortalCam
*
* Created by Albert Hwang on 5/25/12.
* Copyright 2012 Phedhex. All rights reserved.
*
*/
#include "ofMain.h"
#include "ofxOpenNI.h"
#include "ofxRay.h"
#include "ofxXmlSettings.h"
#define CALIBRATION_STEPS 12
class ofxPortalCam : public ofCamera {
public:
ofxPortalCam();
void begin();
void end();
void drawCalib();
void createCalibRay();
ofxOpenNIUser getViewerBody();
void loadCalib();
void saveCalib();
void resetCalib();
bool needsCalib();
// transforms kinect space into screeen space
ofVec3f screenify(ofVec3f kinectPoint);
void tweakOrientation();
protected:
ofCamera myOfCamera;
ofxOpenNI kinectDevice;
ofxOpenNIUser user;
void userEvent(ofxOpenNIUserEvent & event);
bool calibDone;
int calibStep;
void calcCalib();
ofRay calibRays[CALIBRATION_STEPS];
ofxXmlSettings calibFile;
ofVec3f displaceFactor;
float scaleFactor;
ofVec3f rotation1Perp;
float rotation1;
ofVec3f rotation2Perp;
float rotation2;
ofVec3f tweakPerp;
float tweakAngle;
ofVec3f screenNormal;
};