PVector Array & SimpleOpenNI + Kinect
in
Contributed Library Questions
•
3 months ago
Hi there , I am using the SimpleOpenNI library for processing, in conjunction with the Kinect hardware. I am trying to recreate this effect:
I can create vertical gaps in the point cloud by changing the number in the update portion of the array [
for (int i = 0; i < depthPoints.length; i+=5) ] .
Rather, I would like to create horizontal gaps within the point cloud, but I'm not sure how to write the code to ignore chunks of the array in this way.
CURRENT CODE:
- import processing.opengl.*;
- import SimpleOpenNI.*;
- SimpleOpenNI kinect;
- void setup() {
- size(1024, 768, OPENGL);
- kinect = new SimpleOpenNI(this);
- kinect.enableDepth();
- }
- void draw() {
- background(0);
- kinect.update();
- translate(width/2, height/2, 0);
- rotateX(radians(180));
- stroke(255);
- strokeWeight(1);
- PVector[] depthPoints = kinect.depthMapRealWorld();
- for (int i = 0; i < depthPoints.length; i+=5)
- {
- PVector currentPoint = depthPoints[i];
- point(currentPoint.x, currentPoint.y, currentPoint.z);
- }
- }
If anyone has any tips or advice on how to achieve this effect it would be greatly appreciated!
1