react-globe.gl
react-globe.gl copied to clipboard
Accessing Current Scene/Renderer/Camera and modifying properties does not change rendered output
When using the camera()
, scene()
, and renderer()
functions to access the internals of the Globe, changing any of their properties does not reflect in the rendered globe.
For example:
const scene = globeEl.current.scene();
scene.add(new THREE.AmbientLight(0xbbbbbb, 0.3));
scene.background = new THREE.Color(0x040d21);
Neither adds an ambient light, nor affects the background color of the scene.
According to the docs, modifying these underlying controls should result in an affect on the rendered output.
Please let me know if I'm just missing something super simple.
@ericschmar the background shouldn't be modified directly on the scene, otherwise it will be overwritten by the module which is probably what is happening here. You can tell that to the module via:
backgroundColor="#040d21"
As for the additional ambient light, I don't see an immediate reason why it shouldn't be working. If you still haven't got it to work, please make a simplified example on https://codesandbox.io/ so we can have a closer look.
I would try something similar to what i did here