Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change scene.pickPosition to globe.pick on Sandcastle #7261

Closed
OmarShehata opened this issue Nov 13, 2018 · 2 comments
Closed

Change scene.pickPosition to globe.pick on Sandcastle #7261

OmarShehata opened this issue Nov 13, 2018 · 2 comments

Comments

@OmarShehata
Copy link
Contributor

It came up on the forum that setting baseLayerPicker: false makes scene.pickPosition report an incorrect position.

I was about to open a bug for this since I don't think turning off the widget should change this behavior (right?) when I tried @hpinkos 's suggestion here to use globe.pick instead, and that works pretty well.

You can test this in this Sandcastle by turning off the widget and trying to draw:

https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/?src=Drawing%20on%20Terrain.html

This issue is to at least change the Sandcastle to use globe.pick if that's a more stable function. Should there be a separate issue for the baseLayerPicker or should I just make a comment in the scene.pickPosition returns incorrect position issue?

@hpinkos
Copy link
Contributor

hpinkos commented Nov 13, 2018

For turning off the widget, see #6991
BaseLayerPicker secretly sets globe.depthTestAgainstTerrain = true. pickPosition only works decently well when it's set to true, so when the widget isn't included depthTestAgainstTerrain is false and pickPosition stops working.

I agree that the example would be better using globe.pick instead for picking terrain. I would only recommend using pickPosition for picking the exact position on a 3D tiles or glTF model.

@ggetz
Copy link
Contributor

ggetz commented Jan 23, 2023

Closing this as the root issue is #4368.

@ggetz ggetz closed this as completed Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants