I'm having some very strange problems with my code, and I have been so far baffled.
Even the beginDraw() example sketch is throwing a Null Pointer Exception:
PGraphics pg;
void setup() {
size(100, 100);
pg = createGraphics(80, 80, P2D);
}
void draw() {
pg.beginDraw();
pg.background(100);
pg.stroke(255);
pg.line(40, 40, mouseX, mouseY);
pg.endDraw();
image(pg, 10, 10);
}
...giving this error:
Exception in thread "Animation Thread" java.lang.NullPointerException
at processing.opengl.PGL.getString(PGL.java:1029)
at processing.opengl.PGraphicsOpenGL.getGLParameters(PGraphicsOpenGL.java:6076)
at processing.opengl.PGraphicsOpenGL.beginDraw(PGraphicsOpenGL.java:1547)
at sketch_120907a.draw(sketch_120907a.java:29)
at processing.core.PApplet.handleDraw(PApplet.java:2120)
at processing.core.PGraphicsJava2D.requestDraw(PGraphicsJava2D.java:197)
at processing.core.PApplet.run(PApplet.java:1998)
at java.lang.Thread.run(Thread.java:680)
I'm running Processing 2.0b1 on a relatively new MacBook Pro (Mountain Lion). This code works fine in Processing 1.5.1, but I'm still getting a lot of weird behavior in all versions, from sketches that previously worked fine. I thought at first it was a result of the new Java 1.6 update 35 that was pushed yesterday, but I've tried different sketches on a friend's computer with update 33 and Processing 2.0a7 and it returned the same results. Any ideas? Is it an OpenGL issue?
I have two different PImages that I'd like to combine into one PImage. They are both 1920x1080 pixels, and I'd like to combine them into one 3840x1080 image so that I can send it to an external application, essentially appending the second image to the right of the first. Can anyone recommend how to achieve this?
Will I need to load them into pixel arrays? If so, once I do how do I convert the resultant pixel array back into a PImage? If there is a less processor intensive way to do this, that'd be preferable. Thanks in advance.
I've been using the Syphon library to send video frames from my Processing sketches to other applications like MadMapper and Modul8, but I want to know if it's possible to receive video from other applications.
Currently, I'm using the SyphonServer class, and it has the method
sendImage(), which sends a
PImage to a client-- in this case, MadMapper or Modul8. Is there a way to setup a SyphonClient in Processing so that I can receive video from Modul8? I've looked at the documentation and don't see any methods that seem to provide this type of functionality...
I just downloaded and installed the controlP5 library (v0.6.12) onto my Mac by putting in the ./Documents/Processing/libraries folder. When I run the ControlP5controllerOnTop3D.pde example, it returns the following error message:
java.lang.NullPointerException
at processing.app.Library.getClassPath(Library.java:285)
at processing.mode.java.JavaBuild.preprocess(JavaBuild.java:405)
at processing.mode.java.JavaBuild.preprocess(JavaBuild.java:197)
at processing.mode.java.JavaBuild.build(JavaBuild.java:156)
at processing.mode.java.JavaBuild.build(JavaBuild.java:135)
at processing.mode.java.JavaMode.handleRun(JavaMode.java:176)
at processing.mode.java.JavaEditor$20.run(JavaEditor.java:481)
at java.lang.Thread.run(Thread.java:680)
I am using Processing 2.0a4 because I need to use JSyphon. I intended to use controlP5 to add a hideable menu that would hover over a 3D sketch. Does controlP5 work in Processing 2.0a4? There were a couple of other examples that returned the same error. I didn't change the code in any of them.
I have a sketch, and I'm using Syphon to output the image to another application. I want to project a 3D model onto a real world instance of itself. I'm very close, but I'm finding that the focal length of the computer generated image is causing the perspectives to be out of sync.
I tried using the Proscene library, and I can get the adjustments I need, but I can't figure out how to use Syphon and Proscene in the same sketch.