Closed eljeffeg closed 13 years ago
Please, when filing a bug report here, be as specific and detailed as possible.
I haven't had time to look into the specifics - it's a heads up where we can discuss it further. It doesn't give an error to include - it just doesn't work. If I had to guess, I'd say it was an issue related to PGraphics or PMatrix3D within PeasyCam.java. If I already knew what the problem was, I would have fixed it in my fork and pushed an update. Here is an example of code that doesn't work. Note you'll need to use P5 build 0195 or build from source.
import peasy.*; import processing.opengl2.PGraphicsOpenGL2;
PeasyCam cam;
void setup() { size(200,200,OPENGL2); cam = new PeasyCam(this, 100); cam.setMinimumDistance(50); cam.setMaximumDistance(500); } void draw() { rotateX(-.5); rotateY(-.5); background(0); fill(255,0,0); box(30); pushMatrix(); translate(0,0,20); fill(0,0,255); box(5); popMatrix(); }
I did some testing to try and figure out where this problem was coming from. PeasyCam does not report any errors - it just didn't work, so I apologize for the lack of specifics in my bug report. From what I can tell though, this looks to be an issue with OpenGL2 and not PeasyCam.
After a bit of testing, I found that if you add "cam.feed()" to the draw(), PeasyCam works fine. Further testing revealed that it appears OpenGL2 is resetting the camera matrix every draw. Just using the basic example of camera, but placing the camera transform in the setup will display the issue. OpenGL2 reverts the matrix, unless you specify the camera in each draw().
import processing.opengl2.PGraphicsOpenGL2;
int x; void setup() { size(200, 200, OPENGL2); camera(70.0, 35.0, 120.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0); } void draw() { if (x < 30) { camera(70.0, 35.0, 120.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0); //Example so you can see it change after 30 frames x++; } noFill(); background(204); translate(0, 0, 0); rotateX(-PI/6); rotateY(PI/3); box(45); }
Jon, just wanted to let you know that OpenGL2 has been made the default OpenGL / P3D renderer in the latest builds (198,199) and for 2.0. As of now, PeasyCam does not work with it. As described above, I believe it to be an issue with the new OpenGL resetting the matrix every frame, but I wanted to keep you up to date on it just in case you want to try to fix the core.
Thanks, Jeff. When I next have a couple of hours, I'll look into it.
Hi. When Processing 2.0 comes out, I'll be sure to look into this again. The current release, 1.5.1, does not include OpenGL2.
Just wanted to let you know that Andres checked in a update 30min ago (r8243) that resolves the last of the identified issues with PeasyCam, which was described in bug report 750 (http://code.google.com/p/processing/issues/detail?id=750). The "cam.feed()" issue was also resolved in an earlier fix. As of now, it looks like all is working well.
PeasyCam does not work with the new OpenGL2 of Processing.