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

Cannot select entities in 2D when zoomed out #7868

Closed
gcatto opened this issue May 24, 2019 · 2 comments · Fixed by #7908
Closed

Cannot select entities in 2D when zoomed out #7868

gcatto opened this issue May 24, 2019 · 2 comments · Fixed by #7908

Comments

@gcatto
Copy link

gcatto commented May 24, 2019

Steps to reproduce:

  • Navigate to the Billboard Sandcastle app (link below)
  • Switch to 2D mode
  • Zoom all the way out
  • Try to click to select the Cesium logo, but be unable to do so
  • Zoom in some
  • Try to click to select the Cesium logo again and one will be able to

Edit: if one uses Cesium.MapMode2D.ROTATE instead of Cesium.MapMode2D.INFINITE_SCROLL, the problem does not seem to happen

Sandcastle example: https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/#c=1Vp7T9tIEP8qFv/gSOnGefEoUB2PcEQCgkJK1SsV2tiTeHUbO1pvoKHiu9+s7cTvxLTA0UhBznpmdua3M7Ozs9xTod0zeAChHWgOPGjH4LHZhNz4Y/qm6f88dh1JmQNis7J369w6o5ljSuY6GrWsI8b50KXC0ivaz1tHw881dSyTepIDscDkVIAeJwxkKMJgZgKOZJKBR5BKD2Woz9T1mD/Nx4Vax1RIfKJOk4yEOzmBsQDw9A/bbdLe3d7ermotgxjNnZ1mpRrJGS5m1j7GpKsPm9AxoPhNQmr+s1cLZro7d8funXsPgtM5mTrjzYjxKXh8UnY8JeDwQC6tvBLuFIQyayUw+Sz/J0Tar2NU1Wo1zYIRnXH5UZs5+IheYyXlebb7gOKkmEGcPkk0ZT+A90YjhAdpY465NK+hG1XtQ9uoJCdVo0YlKQzmsFJUU0dEkC38UylWy3YFe1TBwHuCjVkM9rPUG3LcuRx0+sWi7tVKm1lBN4lxctQbDHoXSRsD0SlUkUWtUkMZESeuEyNJabrcFTF/UT/Jefeik+T7ctYddJKcwpU06WwXVNrkqn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ADy5cttKE0d7VmqGqHWXnTq2iFmu0DZ1BJDwxRXcGgQ0emr9PdzxgYy5O1TqhfocjpHSkyELilNNt5c/2dYbDVLfbeMitbbwod5+nZZBcELpwwgEBDXNojJMviDH54cXV3eD3t3f/d7ny5OUmPSixWqky9lkiIhc9a67g+5N5657edq97A6+ro2+sEuZQnTpczHXQZAHrsuHVFyAM9O//Vz4yw9VY26qQmeJ2AIA1/GAY1io3tLiuJk4aCYvRmNngtjENmLEFU6Z29HQrqeqllLmGuveaPmmy1sFrKs03yNRkdI6Ft1WrtO2+MqyUO9j/zokV/XS6q64iFmn8crbmGKw2WNcZQzXid8qLw9w/s3DWnyLrh8KNVU+Oglb6LFq/DnemtezL+G2+Y37Ykj9K57hfNGfsMJILw9pujW7Fsxsf7ZQu1Nq/ZZy6d7mOt2yDc5C1cIz728ol20GrlOvqCNY7IL+gfFXHTBzOi3jfjlH1EIVT4Jtxj+H+hsyvvGkpjqbGlYPkyn47bqxUHVPadWz5ck6vfNqlIXS34OCJcYnQC38wXJ2LZo+3NxMOsFjOBnx+Zk7Ad0oqkMFTPA8fsi5HlVFbKTp4Z4d3onrqZKnkrC2sCzKr6LyC6/l/fteRnC5omlEuQcx1PBxo7qx78k5h0/B8F9sMnWF1GaC61jMSJhMORZsXm04M/8FSUzPd5b92oJp32L3GrMObjdS//N0u6G8w/PwzWjGudoVbjc+7deQPsHGXaqq5V7Q4VYkdv3TeTBICNmv4c8slwxKj5jE/wA

Browser: Chrome

Operating System: Win10

@OmarShehata
Copy link
Contributor

Thanks for reporting this and for the Sandcastle @gcatto. This is definitely a bug. I'm not sure when we'll have time to look into a fix here, but here are my debugging notes if anyone wants to give it a shot.

  1. The picking of entities happens in the Viewer here:

https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Widgets/Viewer/Viewer.js#L112

This is supposed to return the billboard when you click on it, but returns undefined when you're zoomed all the way out.

  1. The pick function is in Scene.js here:

https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Scene/Scene.js#L3533

This is what's returning undefined. The way this picking works is that Cesium renders the scene to a framebuffer, with a unique color for each object, and then reads back those pixels to figure out what object you clicked on.

  1. The reading of the pixels happens in PickFramebuffer.js here:

https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Scene/PickFramebuffer.js#L119

It is specifically this line:

var object = context.getObjectByPickColor(colorScratch);

In a successful pick, colorScratch has a non-zero value. When you zoom all the way out and click on the billboard, you get a color with all zero's. So it's almost as if it's not correctly rendering to the pick framebuffer when you're zoomed all the way out?

@lilleyse do you have any other advice or thoughts to add?

@lilleyse
Copy link
Contributor

lilleyse commented Jun 5, 2019

Opened a fix here #7908

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

Successfully merging a pull request may close this issue.

3 participants