vasturiano / react-globe.gl

React component for Globe Data Visualization using ThreeJS/WebGL
https://vasturiano.github.io/react-globe.gl/example/world-population/
MIT License
818 stars 150 forks source link

Scene rotation and lighting #132

Open jo185128 opened 11 months ago

jo185128 commented 11 months ago

Describe the bug The scene looks to be rotated everything rather than the globe itself. When I changed the lighting and position, it caused weird behavior visually. To Reproduce https://codesandbox.io/s/hex-points-6dn7q9?file=/src/TestGlobe.js

Expected behavior Have a static directional light that does not move on globe rotation or control. There is also a weird behavior with the light such that is only lights up half the globe and not dynamically changed bases on the position of the light/globe

Screenshots Here is a video of the issue

https://drive.google.com/file/d/12FslkFQZjLJfMTALt9odKMXvBuS-gnll/view?usp=sharing

Why do the lights rotate with the globe? How can I isolate the globe and the lights so that when i rotate the globe, it does not rotate the lights with it?

I was even able to add a new light to the scene, but it follows the same behavior.

vasturiano commented 11 months ago

@jo185128 when you are interacting with the canvas via click-drag, you are in reality not rotating the globe, but instead you're moving the position of the camera around the globe. This is done using ThreeJS Orbit Controls.

So essentially everything in the scene stays exactly where it is in relation to each other including the globe and all the lights. It's only your point of view that's changing. This probably explains what you're describing above.