GLGraphics and SimpleOpenNI: Exception
in
Contributed Library Questions
•
1 year ago
I want to use SimpleOpenNi and GLGraphics together in one sketch. Because I had lots of problems to get it working, I stripped down my program to make the exception reproducable in simple context
- import SimpleOpenNI.*;
SimpleOpenNI context;
import processing.opengl.*;
import codeanticode.glgraphics.*; - int[] depthValues;
void setup() {
context = new SimpleOpenNI(this); - // enable depthMap generation
context.enableDepth();
size(640,480,GLConstants.GLGRAPHICS);
// size(640, 480);
background(100);
}
void draw() {
context.update();
depthValues=context.depthMap();
image(context.depthImage(), 0, 0);
}
Running this sketch throws an exception (see below)
Using size(640, 480) instead of size(640,480,GLConstants.GLGRAPHICS);
makes it run.
makes it run.
All examples from SimpleOpenNI and GLGraphics work on my systems.
I am on processing 1.5.1, GLGraphics 1.0.0 and SimpleOpenNi 0.27.
I used Vista32 Bit and XP to test it.
Any help is of course appreciated
knut
Exception in thread "Animation Thread" java.lang.NullPointerException: null array
at SimpleOpenNI.SimpleOpenNIJNI.ContextWrapper_depthMap(Native Method)
at SimpleOpenNI.ContextWrapper.depthMap(ContextWrapper.java:219)
at SimpleOpenNI.SimpleOpenNI.updateDepthRaw(SimpleOpenNI.java:827)
at SimpleOpenNI.SimpleOpenNI.depthMap(SimpleOpenNI.java:432)
at testOpenNiGLGraphics.draw(testOpenNiGLGraphics.java:44)
at processing.core.PApplet.handleDraw(Unknown Source)
at processing.core.PApplet.run(Unknown Source)
at java.lang.Thread.run(Thread.java:662)
at SimpleOpenNI.ContextWrapper.depthMap(ContextWrapper.java:219)
at SimpleOpenNI.SimpleOpenNI.updateDepthRaw(SimpleOpenNI.java:827)
at SimpleOpenNI.SimpleOpenNI.depthMap(SimpleOpenNI.java:432)
at testOpenNiGLGraphics.draw(testOpenNiGLGraphics.java:44)
at processing.core.PApplet.handleDraw(Unknown Source)
at processing.core.PApplet.run(Unknown Source)
at java.lang.Thread.run(Thread.java:662)
I tested this on Vista
1