I would like to be able to see through transparent 3D shapes. For example, this:
void setup() {
size(400, 400, P3D);
}
void draw() {
clear();
translate(width/2, height/2, -width/2);
stroke(255);
fill(0, 255, 255, 100);
box(width);
noStroke();
lights();
fill(255);
sphere(100);
}
...displays this:

but I want this:

Note that I just added hint(DISABLE_DEPTH_TEST) for the second one. I would like a solution without this because, you know, it disables the depth test.
I recommend to draw the box with disabled depth test. But enable the depth test before the sphere is drawn:
void draw() {
clear();
translate(width/2, height/2, -width/2);
hint(DISABLE_DEPTH_TEST);
stroke(255);
fill(0, 255, 255, 100);
box(width);
hint(ENABLE_DEPTH_TEST);
noStroke();
lights();
fill(255);
sphere(100);
}

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With