SubstanceD / simple-openni

Automatically exported from code.google.com/p/simple-openni
0 stars 0 forks source link

NullPointer error for depthMap in OPENGL mode #1

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
If I use depthMap generation switched on with enableDepth() and accessed with 
context.depthImage(), I get a nullPointer exception when I am in OPENGL mode 
(P3D mode doesn't work either). It seems impossible to use simple-openni in 
OPENGL mode.

I was adapting my previous code (which used OSCelelton), but the error can be 
reproduced by just adding OPENGL import etc to the SimpleOpenNI sample sketch.

I am using 0.11 on OSX 10.6 on a MacBook Pro.

Original issue reported on code.google.com by andykino...@gmail.com on 27 Feb 2011 at 1:17

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I can't reproduce your problem. I changed the 'SimpleOpenNI_DepthImage' 
example, line 33:
size(context.depthWidth() + context.rgbWidth() + 10, 
context.rgbHeight(),OPENGL); 

This works with version 0.13.  P3D Mode works as well, there are some examples 
that use P3D. Please check if you still have problems and in that case, please 
give me a simple example prog.

Original comment by m...@paus.ch on 7 Mar 2011 at 3:44

GoogleCodeExporter commented 8 years ago
This can be closed as not an issue. I think that the cause may be that XML 
config file may have been missing the relevant section.

Original comment by andykino...@gmail.com on 10 Mar 2011 at 1:33

GoogleCodeExporter commented 8 years ago
ok, then i close it

Original comment by m...@paus.ch on 11 Mar 2011 at 12:02

GoogleCodeExporter commented 8 years ago
hey; I'm trying to draw the IR image in an offscreen buffer to use it with the 
keystone library, I'm trying in OPENGL and P3D renderers and the whole sketch 
just stays gray and freezes without returning any error.

here is the code

import processing.opengl.*;
import codeanticode.glgraphics.*;
import deadpixel.keystone.*;
import SimpleOpenNI.*;

SimpleOpenNI context;
GLGraphicsOffScreen offscreen;

//PGraphics offscreen;

Keystone ks;
CornerPinSurface surface;

void setup()
{

  size(640, 480, GLConstants.GLGRAPHICS);  // strange, get drawing error in the cameraFrustum if i use P3D, in opengl there is no problem
  //size(640, 480, P2D);  // strange, get drawing error in the cameraFrustum if i use P3D, in opengl there is no problem
  offscreen = new GLGraphicsOffScreen(this, width, height);
  //offscreen = createGraphics(width, height, P2D);
  context = new SimpleOpenNI(this);
  context.setMirror(false);
  context.enableIR();

  ks = new Keystone(this);
  surface = ks.createCornerPinSurface(width, height, 20);

  stroke(255, 255, 255);
  smooth();
}

void draw()
{
  context.update();
  offscreen.beginDraw();
  offscreen.background(0, 0, 0);
  offscreen.image(context.irImage(), 0, 0);
  offscreen.endDraw();
}

Original comment by dev...@gmail.com on 1 Jun 2011 at 6:22