CesiumGS / cesium

An open-source JavaScript library for world-class 3D globes and maps :earth_americas:
https://cesium.com/cesiumjs/
Apache License 2.0
12.98k stars 3.5k forks source link

Zoom is slower when close to a model #5131

Open rahwang opened 7 years ago

rahwang commented 7 years ago

Reported in the forum here: http://cesiumjs.org/forum.html#!msg/cesium-dev/C_OT9kB9RV8/-zlIMRjWCAAJ

Zooming is slower when the camera is close-ish to a model. Possibly not the proximity to the model, but the fact that the model is "in the center" of the view.

http://cesiumjs.org/Cesium/Apps/Sandcastle/?src=Hello%20World.html&label=Showcases&gist=a4bc90cb451cc3c997566e34a655c5ca

if you change the value of latOffsetin getPositionCentered() you will notice the difference.

mramato commented 7 years ago

This is by design, because of the vast difference that Cesium deals with, the magnitude of zooming with the mouse gets progressively smaller/larger the closer/further away you are from an object.

Now it could be that we need expose a good way to tweak this behavior, but ultimately it's working as intended.

@bagnell can confirm, and if there's no a decent way to tweak this with the existing API, we can leave this open as an issue to add such a capability.

freder commented 7 years ago

I'm working on s.th. where there is a model in front of the camera pretty much all the time – but I still need users to be able to zoom normally. — is there a workaround to disable this?

I can see why you'd want this kind of behaviour, but it has caused me a bit of headache to figure out what is actually happening. in general I'd say make it opt-in for those who (know they) need this, rather than the default behaviour.

bagnell commented 7 years ago

@mramato is right that this is by design. In the mean time, you can add this to disable it: scene.screenSpaceCameraController.minimumPickingTerrainHeight = 0.0;

We need to update the name. If you have the depth texture extension, the camera will pick the depth texture which includes models and other geometry. If the extension is unavailable, th eterrain mesh is picked.

@freder I'm not sure the now default behavior should be opt-in behavior. The linked Sandcastle example seems unusual where the model is always in front of the camera. What is the use case for that?

Updated forum link: https://groups.google.com/forum/#!topic/cesium-dev/C_OT9kB9RV8

pjcozzi commented 7 years ago

@bagnell could you please suggest a new name and some guidance for @rahwang to make this change?

pjcozzi commented 7 years ago

@bagnell any thoughts on https://github.com/AnalyticalGraphicsInc/cesium/issues/5131#issuecomment-288228977?