We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi @GoToLoop, so I decided to use this sketch ( http://forum.processing.org/two/discussion/3771/point-cloud-and-peasycam#Item_3 )you shared! I want use it in a basic kinect display, where the "points" are only the person's body with the kinect.. The sketch is rather simple.. But I want to put points where "userMap[index] != 0 " I'm trying this but getting null pointer exception. :( Any idea on how I can implement that example in this:
import SimpleOpenNI.*;
SimpleOpenNI context;
PImage userImage;
int[] userMap;
PImage rgbImage;
color pixelColor;
void setup(){
size(640,480);
context=new SimpleOpenNI(this);
context.enableRGB();
context.enableDepth();
context.enableUser();
userImage=createImage(640,480,RGB);
}
void draw(){
background(0);
context.update();
rgbImage=context.rgbImage();
userMap=context.userMap();
for(int y=0;y<context.depthHeight();y++){
for(int x=0;x<context.depthWidth();x++){
int index=x+y*640;
if(userMap[index]!=0){
pixelColor=rgbImage.pixels[index];
userImage.pixels[index]=color(0,255,0);
}else{
userImage.pixels[index]=color(0);
}
}
}
userImage.updatePixels();
image(userImage,0,0);
}
Answers
Update: I also came across something similar: http://www.openprocessing.org/sketch/149337 but I am still confused on how I can compensate this in my above kinect example.. :(
Sorry, I dunno much about 3rd-party libraries and can't help ya out! :-S