Loading...
Logo
Processing Forum
it's strange, I've several PNG's ordered in same position except z-axe but i can only see the first one. this problem occurs only with openGL renderer. P3D works fine, except the performance is horribles

Copy code
  1. import processing.opengl.*;
    PImage img;
    PImage[] images = new PImage[13];
    float grad = 0;

    void setup() {

     size(506, 900, OPENGL);
     img = loadImage("samuellebowitz-01.png", "png");
    }

    void draw() {
      println("frameRate: " + frameRate);
      background(255);
      for (int i = 1; i<14; i++) {
         pushMatrix();
          translate(width/2, height/2, i*-1000);
          imageMode(CENTER);
          rotateZ(radians(grad));
          grad +=0.01;
          image(img, 0, 0);
         popMatrix();
      }
    }
P3D Renderer shows the images well, but same sketch with opengl renderer not. this is the PNG File I've used:




Replies(3)

Try drawing the image into a PGraphics object instead. That may not help, but I know that PGraphics are better at supporting transparency.
Which version of Processing are you using? I suspect that it is 1.5.1 because P3D and OPENGL are different renderers. Try your sketch with the latest version 2.0a5 and see if that helps.

The other thing to consider is whether to use a 3D renderer because your final display is 2D. It would probably be faster to use JAVA2D and draw the image repeatably but with different sizes. The image() method not only allows you to specify the x/y position but also the final width and height.

Thanks for both responses:
- processing  2.0a5 has same issue
- about 2D - now in my final screen i will change perspective of the camera (check attachment)
- i need the OPENGL renderer - the other renderes has low framerate with so many image instances :-( also the antialiasing (rendering?) of the images is not nice...
- like you see in my attached image, the transparent PNG's will showed correctly now: the solution was quite simple but strange, I've positioned the camera BEHIND the image and mirrored the image...funny.

3d view of the images.