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

Scene pickPosition Result Wrong with Viewer Option baseLayerPicker false #6990

Closed
mlptownsend opened this issue Aug 31, 2018 · 2 comments
Closed

Comments

@mlptownsend
Copy link

Cesium version 1.48, Win 10 Professional, Intel HD Graphics 520 driver v23.20.16.5018. Reproduces locally on Chrome 68.0.3440.106, Firefox Quantum 61.0.2, Edge. IE not supported (Picking from the depth buffer is not supported. Check pickPositionSupported.) Also reproduced on a different computer using Firefox 61.0.2.

Cesium 1.47 and 1.44 also appear to be affected.

Problem:
When initializing the Viewer, providing false for baseLayerPicker can cause Scene.pickPosition to return an incorrect value for the provided screen x & y coordinates. If true is provided or not specified, Scene.pickPosition correctly returns the position.

My guess is that it's somehow height related, since CLAMP_TO_GROUND is also specified.

Sandcastle examples:
An entity is created and its position is updated via a mouse move event handler.
Expected behavior: baseLayerPicker true
Broken: baseLayerPicker false
Broken: Drawing on Terrain sample with baseLayerPicker false

Screenshot. Mouse was moved across the Great Lakes.
cesiumscenepickposition

@hpinkos
Copy link
Contributor

hpinkos commented Aug 31, 2018

Hello @mlptownsend, thanks for submitting this issue! The problem is actually that BaseLayerPickerViewModel is secretly setting scene.globe.depthTestAgainstTerrain = true; if you pass in a terrain provider to Viewer. You can set viewer.scene.globe.depthTestAgainstTerrain = true; yourself to fix the problem.

I'm going to open up an issue to discuss whether BaseLayerPicker should be setting depthTestAgainstTerrain. I don't think that it should.

And we have an issue open here about using pickPosition without depthTestAgainstTerrain #4368

@mlptownsend
Copy link
Author

Thanks for the quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants