In my Three.js scene, I've integrated OrbitControls.js for rotation and panning functionality. However, I'm facing an issue with the lighting setup - I want the lighting to move along with the camera, ensuring that the object is always well-illuminated, rather than having a "dark side" when rotated.
One approach I tried was making each light a child of the camera:
scene.add(light);
camera.add(light);
Unfortunately, this didn't achieve the desired effect. Another solution I considered was tracking the changes in the camera's spherical coordinates and updating the lights accordingly, but this method has its drawbacks.
As a newcomer to Three.js, I'm hopeful that there might be a simpler solution that I'm not yet aware of. Any guidance or suggestions would be greatly appreciated. Thank you!