I just noticed that the transparency of the .png files(and maybe other transparencies too) sometimes just won't work correctly if you move the .png thru the Z axis.
To show my point this is the code:
//////////////CODE
import processing.opengl.*;
PImage t1,t2;
int r=0;
float x=0;
void setup(){
//Asuntos de pantalla
size(400, 400, OPENGL);
t1=loadImage("t1.gif");
t2=loadImage("t2.gif");
}
void draw(){
translate(-250,-250,0);
background(0);
pushMatrix();
x+=0.05;
//rotateX(sin(x));
translate(0,0,100*sin(x));
image(t1,0,0);
//translate(100*sin(x)+cos(x),0,0);
image(t1,40,0);
//translate(tan(x),0,0);
image(t1,40,0);
popMatrix();
pushMatrix();
x+=0.05;
//translate(40*sin(x),0,0);
image(t2,20,20);
popMatrix();
}
///////////CODE
And the pair of images:
http://julio33.com/p5/t1.png
http://julio33.com/p5/t2.png
I think that when the blue image advance, it should show part the gray image, but it doesn't.
Also I try this with .gif, it's the same.
Thanks,
Julio
To show my point this is the code:
//////////////CODE
import processing.opengl.*;
PImage t1,t2;
int r=0;
float x=0;
void setup(){
//Asuntos de pantalla
size(400, 400, OPENGL);
t1=loadImage("t1.gif");
t2=loadImage("t2.gif");
}
void draw(){
translate(-250,-250,0);
background(0);
pushMatrix();
x+=0.05;
//rotateX(sin(x));
translate(0,0,100*sin(x));
image(t1,0,0);
//translate(100*sin(x)+cos(x),0,0);
image(t1,40,0);
//translate(tan(x),0,0);
image(t1,40,0);
popMatrix();
pushMatrix();
x+=0.05;
//translate(40*sin(x),0,0);
image(t2,20,20);
popMatrix();
}
///////////CODE
And the pair of images:
http://julio33.com/p5/t1.png
http://julio33.com/p5/t2.png
I think that when the blue image advance, it should show part the gray image, but it doesn't.
Also I try this with .gif, it's the same.
Thanks,
Julio
1