react-globe.gl icon indicating copy to clipboard operation
react-globe.gl copied to clipboard

Accessing Current Scene/Renderer/Camera and modifying properties does not change rendered output

Open ericschmar opened this issue 1 year ago • 2 comments

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 avatar Jul 07 '23 14:07 ericschmar

@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.

vasturiano avatar Jul 11 '23 21:07 vasturiano

I would try something similar to what i did here

jo185128 avatar Jul 18 '23 13:07 jo185128