We are about to switch to a new forum software. Until then we have removed the registration on this forum.
hello,
i am building a 3d scene, where some objects are in front of the other.
i want to fade out the scene, but in doing so, the object behind is visible as soon as the alpha starts to drop.
somehow i want to have the front object retain its 'opaqueness', yet fading out at the same time.
for instance in filming the real world, a crossfade does not reveal what is behind a given object.
how can i give this solidity to a 3d object that is in front of all the others?
i tried with PGraphics and clear() and some blendModes, but am not having much luck.
float a = 0;
void setup() {
size(400, 400, P3D);
}
void draw() {
background(0);
translate(width/2, height/2);
noFill();
a = map(mouseX, 0, width, 0, 255);
fill(255, a);
noStroke();
box(50);
pushMatrix();
translate(100, 0);
box(50);
popMatrix();
pushMatrix();
translate(-100, 0);
box(50);
popMatrix();
sphere(50);
}
Answers
Can you describe in more detail what fading out looks like? Try to break it down into very small steps that each last much less than a second. What is happening when it starts to fade? What is happening when it's almost completely faded?
after some research i think what i need is back face culling. i tried some experiments with PGL calls but didn't have much luck. think its a bit beyond me for the timeline i have ahead of me so i think i'll have to fix it in a lofi way
Back face culling is the way to go:
Don't know if there's a hint() for this? :/
thank you poersch u made me realise i had my code in the wrong order