Hi, I'm trying to make the ability to doodle in front of a constantly updating SimpleOpenNi camera feed. The fact that the feed needs to update every loop has me stumped, as I need to have the miniature ellipses successively created by the drawing function stay visible, instead of being overridden by the feed's next frame. I tried putting the draw function in its own void loop and calling it first thing in void draw, didn't work.
I also tried using this
Layers library, but for some reason it doesn't work when combined with the SimpleOpenNi library in one sketch. It leaves the whole applet window white, except for a top-left 100*100 square portion which functions properly. Both libraries and all the code I'm using with them work individually, but just not together for some weird reason...
I don't expect to be able to solve this problem myself, as it seems like an issue with the source code, or that they're simply incompatible with each other, so I'm wondering if anyone else knows of any other options to achieve this? Any tips/ideas would be awesome.
This is my main sketch:
/OPENNI
import SimpleOpenNI.*;
SimpleOpenNI context;
//LAYERS
import com.nootropic.processing.layers.*;
AppletLayers layers;
void setup() {
//LAYERS
layers = new AppletLayers(this);
drawing m = new drawing(this);
layers.addLayer(m);
//CAM PARAMS
// instantiate a new context
context = new SimpleOpenNI(this);
// enable depth image generation
context.enableDepth();
// context.enableRGB(640,480,30);
// create a window the size of the depth information
at processing.app.Sketch.placeException(Sketch.java:1543)
at processing.app.debug.Runner.findException(Runner.java:583)
at processing.app.debug.Runner.reportException(Runner.java:558)
at processing.app.debug.Runner.exception(Runner.java:498)
at processing.app.debug.EventThread.exceptionEvent(EventThread.java:367)
at processing.app.debug.EventThread.handleEvent(EventThread.java:255)
at processing.app.debug.EventThread.run(EventThread.java:89)
Exception in thread "Animation Thread" java.lang.NullPointerException
at midterm.draw(midterm.java:278)
at processing.core.PApplet.handleDraw(PApplet.java:1606)
at processing.core.PApplet.run(PApplet.java:1503)
at java.lang.Thread.run(Thread.java:680)
Why? What do I have to do for this to work? In the player2 class, I'm using .png sprites to animate the player's movement (up down left right). In the enemy1 class, 'jellyfish' is an animated gif being called with the gifAnimation library, and they're also being called in an arrayList. Any ideas on the source of the issue?
I'd post the whole sketch but it's all a huge mess and I don't want to confuse anyone who might be able to spot the issue without it. Any tips at all would be greatly appreciated!