Commit a5836b9d by wester

range

parent 7f3cf6f8
...@@ -14,6 +14,7 @@ bool init(int argc, char* argv[]) { ...@@ -14,6 +14,7 @@ bool init(int argc, char* argv[]) {
glutInit(&argc, argv); glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA); glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA);
glutInitWindowSize(width,height); glutInitWindowSize(width,height);
glutInitWindowSize(1800, 900);
glutCreateWindow("Kinect VR Point Cloud"); glutCreateWindow("Kinect VR Point Cloud");
glEnable(GL_DEPTH_TEST); glEnable(GL_DEPTH_TEST);
......
...@@ -65,6 +65,9 @@ float KinectSizeX = 0.249; ...@@ -65,6 +65,9 @@ float KinectSizeX = 0.249;
float KinectSizeY = 0.042; // 42 mm, 66mm ist die gesammthhe float KinectSizeY = 0.042; // 42 mm, 66mm ist die gesammthhe
float KinectSizeZ = 0.067; float KinectSizeZ = 0.067;
float minTrackingKinect = 0.8f;
float maxTrackingKinect = 3.5f;
//Vive Tracking //Vive Tracking
SteamTracking* steamTracking = nullptr; SteamTracking* steamTracking = nullptr;
int controllerID = 1; int controllerID = 1;
...@@ -75,7 +78,7 @@ std::vector<glm::vec3> controllerPositions; ...@@ -75,7 +78,7 @@ std::vector<glm::vec3> controllerPositions;
Camera mainCam; Camera mainCam;
static bool trackControllerPos = false; static bool trackControllerPos = true;
static bool writeFile = false; static bool writeFile = false;
static bool captureFrame = false; static bool captureFrame = false;
...@@ -213,7 +216,7 @@ void getRgbData(IMultiSourceFrame* frame) { ...@@ -213,7 +216,7 @@ void getRgbData(IMultiSourceFrame* frame) {
*fvalid++ = false; *fvalid++ = false;
} }
else { else {
if (depth2xyz[i].Z > 1.7f) { if (depth2xyz[i].Z > maxTrackingKinect || depth2xyz[i].Z < minTrackingKinect) {
*fdest++ = 0; *fdest++ = 0;
*fdest++ = 255; *fdest++ = 255;
*fdest++ = 0; *fdest++ = 0;
...@@ -395,6 +398,8 @@ void mainRenderLoop() { ...@@ -395,6 +398,8 @@ void mainRenderLoop() {
//draw Controller Positions //draw Controller Positions
if (trackControllerPos && controllerPosData.size > 1){ if (trackControllerPos && controllerPosData.size > 1){
glColor4f(0.0f, 0.0f, 1.0f, 1.0f);
glBindBuffer(GL_ARRAY_BUFFER, controllerPosData.vboID); glBindBuffer(GL_ARRAY_BUFFER, controllerPosData.vboID);
glVertexPointer(3, GL_FLOAT, 0, NULL); glVertexPointer(3, GL_FLOAT, 0, NULL);
glDrawArrays(GL_LINE_STRIP, 0, controllerPosData.size); glDrawArrays(GL_LINE_STRIP, 0, controllerPosData.size);
...@@ -541,7 +546,7 @@ int main(int argc, char* argv[]) { ...@@ -541,7 +546,7 @@ int main(int argc, char* argv[]) {
controlerToKinect = glm::translate(glm::mat4x4(), (glm::vec3(-4.0f, -7.5f, 13.0f)*0.01f)); //controlerToKinect = glm::translate(glm::mat4x4(), (glm::vec3(-4.0f, -7.5f, 13.0f)*0.01f));
float dx = KinectOriginOffsetX - KinectSizeX/ 2; float dx = KinectOriginOffsetX - KinectSizeX/ 2;
float dy = KinectSizeY / 2.0f + 0.008; // dicke Halterung; float dy = KinectSizeY / 2.0f + 0.008; // dicke Halterung;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment