We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello !
I'm trying to build a simple 3D object from scratch but I have an issue with the opacity. It works with certain rotations but not for all , and I don't know how to get it work correctly.
I tryed to call 'beginShape' for each triangle but it didn't work (the result is the same)
Here is my code :
float rx = 0,ry = 0;
void setup(){
size(1000,1000,P3D);
}
void draw(){
clear();
background(255);
pushMatrix();
translate(width/2,height/2);
pushMatrix();
rotateX(rx);
rotateY(ry);
rx += PI/180;
ry += PI/180;
fill(255,0,0,50);
stroke(0,100);
beginShape(TRIANGLES);
vertex(-100,-100,0);
vertex(+100,-100,0);
vertex(0 ,0 ,+100);
vertex(+100,-100,0);
vertex(+100,+100,0);
vertex(0 ,0 ,+100);
vertex(+100,+100,0);
vertex(-100,+100,0);
vertex(0 ,0 ,+100);
vertex(-100,+100,0);
vertex(-100,-100,0);
vertex(0 ,0 ,+100);
endShape();
popMatrix();
popMatrix();
}
Thanks !
Answers
I found the solution ! (in this post http://forum.processing.org/two/discussion/5898)
I just need to the line hint(DISABLE_DEPTH_TEST);
just before the "beginShape" call. And it works as expected !
I understood where was the problem but it's hard to explain, the discution in the link I give contains some explanations