vasturiano / globe.gl

UI component for Globe Data Visualization using ThreeJS/WebGL
https://vasturiano.github.io/globe.gl/example/world-population/
MIT License
2.06k stars 304 forks source link

Is it possible to move the globe around the canvas? #88

Closed joshwaaaah closed 2 years ago

joshwaaaah commented 2 years ago

I'm wanting to have the globe appear half inside the canvas, so it'd be positioned at the bottom of the canvas and we'd only see the top half. From there, I'd then like to animate a change in camera, which again, re-positions the globe and moves it into full view, centered in the canvas.

Is this possible whilst using this component? I've tried manipulating the camera's z/x axis, but to no avail; whenever I do this, it seems to zoom the camera in / out, as oppose to move the globe (or camera position up down etc.)

Apologies if this isn't the correct place to ask.

vasturiano commented 2 years ago

@joshwaaaah thanks for reaching out.

This component uses OrbitControls centered on the core of the globe, therefore what you are intending doesn't seem possible with this setup as it would require using a different control center.

I would recommend using the lower-level three-globe object so you can setup the scene with more flexibility that allows what you intend. Actually sounds like you've already found that component also, so feel free to discuss any issues there. 😄

joshwaaaah commented 2 years ago

Hi @vasturiano,

Thanks for the reply. No worries, I thought that might be the case, and is exactly what I did.

Thanks a lot for the help, and the great component!