Hello!,
I’m trying to simulate a moving wall and I have a ‘pointLight’ lighting from the position of the camera (approximately).
The problem I’m having is that when the wall moves, the lighting starts to get darker (even with the spotLight on draw).
I honestly don’t know if there’s something I’m missing and I can’t find in the documentation.
An example that reproduces the problem I want to solve is:
int z = 0;
void setup() {
size(1024, 768, P3D);
}
void draw() {
if (z > 1000)
z = 0;
background(0);
pointLight(173, 208, 200,
width/2, height/2, -200);
beginShape();
textureWrap(REPEAT);
textureMode(NORMAL);
vertex(0, 0, z);
vertex(0, 0, -10000+z);
vertex(0, 768, -10000+z);
vertex( 0, 768, z);
endShape(CLOSE);
z += 5;
}
Thank you!