Hi,
Is there a way to set threshold value to the point cloud generated by kinect such that I can get points only in a certain distance range ?
I have been going through the example file and trying to figure out how do i make the mesh add vertex within a threshold
int step = 10; for ( int y = 0; y < h; y += step) { for ( int x = 0; x < w; x += step) { if (kinect.getDistanceAt(x, y) > 0) {
mesh.addColor(kinect.getColorAt(x,y));
mesh.addVertex(kinect.getWorldCoordinateAt(x, y));
}
}
}
this will check the value you get from kinect.getDistanceAt(x,y) to be between your minThreshold and maxThreshold integers.
int step = 10;
int minThresh = 100; // change this for front clipping
int maxThresh = 1000; // change this for back clipping
for ( int y = 0; y < h; y += step) {
for ( int x = 0; x < w; x += step) {
if (kinect.getDistanceAt(x, y) > minThresh && kinect.getDistanceAt(x, y) < maxThresh) {
mesh.addColor(kinect.getColorAt(x,y));
mesh.addVertex(kinect.getWorldCoordinateAt(x, y));
}
}
}
btw if you use three ``` before and after a code segment then it will render your text as code