CesiumGS / cesium-unity

Bringing the 3D geospatial ecosystem to Unity
https://cesium.com/platform/cesium-for-unity/
Apache License 2.0
347 stars 83 forks source link

Scale Changes Y Location #369

Closed markgrossnickle closed 1 year ago

markgrossnickle commented 1 year ago

We are trying to use CesiumGeoreference.scale as our zoom on bing maps. When we change this value the zoom works correctly but the Y position of the map goes up and down. I've used bing maps directly in the past and had a similar issue where the hack fix was to find the lowest vertex in the terrain and set that as our Y offset.

Do you have any similar functionality? Any way we can set the scale without the map sinking down or raising up?

Or perhaps a way I can access the mesh and calc the vert locations myself?

kring commented 1 year ago

Please post questions to the community forum. We use GitHub for bug reports and concrete feature requests.

We don't have any built-in functionality like you're describing. The model should scale around the georeference origin, so if you put that "on" terrain at a particular point, then that point should stay at zero while higher or lower terrain moves nearer or farther as the scale changes.

Why use scale to zoom, though? Rather than either moving the camera or changing its field of view?

markgrossnickle commented 1 year ago

Use case is similar to this: https://github.com/microsoft/MapsSDK-Unity where you have a map sitting on a table. The problem is/was that as you scale the map then drops below the table and floor or raises above your head. I scaled the height now with the geoference's scale and that seems to be working though I'm not sure if that is skewing things are not along the Y axis.