SimpleOpenNI doesn't work with OpenGL
in
Contributed Library Questions
•
1 year ago
Kinect depth image is null for me when the renderer is OPENGL.
The following code works fine for me...
import SimpleOpenNI.*;
SimpleOpenNI kinect;
void setup() {
kinect = new SimpleOpenNI(this);
kinect.enableDepth();
size(640,480);
}
void draw() {
kinect.update();
image(kinect.depthImage(),0,0);
}
But by simply importing processing.opengl.* and changing renderer to OPENGL, i.e. size(640,480,OPENGL), the program crashes on first draw because kinect.depthImage() is null, with the following error.
SimpleOpenNI Version 0.24
Exception in thread "Animation Thread" java.lang.NullPointerException
at SimpleOpenNI.SimpleOpenNI.updateDepthImage(SimpleOpenNI.java:800)
at SimpleOpenNI.SimpleOpenNI.depthImage(SimpleOpenNI.java:402)
at KinectDepthImage.draw(KinectDepthImage.java:55)
at processing.core.PApplet.handleDraw(PApplet.java:1631)
at processing.core.PApplet.run(PApplet.java:1530)
at java.lang.Thread.run(Thread.java:680)
Does anyone know what the issue is? I am on OSX Lion with Processing 1.5.1, SimpleOpenNI version 0.24.
2