Reputation: 1
I've added a DirectionalLightHelper
to my code to illuminate a box. The light is placed at coordinates (2,2,1) and two boxes at (0,0,0) and (3,3,3). The box at (3,3,3) shouldn't be illuminated by the directionalLight, yet it is being illuminated the same way the box at (0,0,0) is. Any insight on this would be really helpful.
Scene Image Here
Upvotes: 0
Views: 46
Reputation: 28502
DirectionalLight doesn’t behave like a panel of light.
light will behave as though it is infinitely far away and the rays produced from it are all parallel.
So when you assign it’s position, it’s actually the vector from where the light rays are coming from, and it’ll affect all objects on the scene.
Maybe you’d like to use layers so the light only affects one box but not the other.
Upvotes: 1