scene.pickPosition returns incorrect position
See original GitHub issueReported on the forum: https://groups.google.com/forum/?hl=en#!topic/cesium-dev/0E-aKBTLESk
The user created this sandcastle example to demonstrate the problem: http://hosting.virtualcitysystems.de/demos/temp/pickProblem/Apps/Sandcastle/?src=3D Tiles.html&label=undefined
The demo is using the latest 3d-tiles branch
pickPosition works fine if you run the example inside sandcastle, but if you click ‘Open in New Window’ sometimes the returned position sits in front of the building you clicked instead of where the click intersects with it. Maybe it’s related to the canvas ratio? See the forum post for more details.
I couldn’t reproduce this with any of our sample models, but I asked the user if he could share a tile for us to test with.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:29 (20 by maintainers)
Top Results From Across the Web
scene.pickPosition return undefined / incorrect position in ...
I am trying to add a simple tool that measures straight line distance between two points using scene.pickPosition and scene.globe.pick.
Read more >scene.pickPosition returns from time to time incorrect values
Most of the times it returns a correct position, but sometimes it seems that the returned point lies some distance (like 10 meters...
Read more >scene.pickPosition returns incorrect position - - Bountysource
pickPosition works fine if you run the example inside sandcastle, but if you click 'Open in New Window' sometimes the returned position sits...
Read more >QGraphicsItem returns wrong position in scene. (Qt4.7.3)
I've had problems with QGraphicsRectItem as well. My current hypothesis is this: The "rect" that you set/get is relative to the item's "pos" ......
Read more >Cesium projection system - GIS Stack Exchange
The Picking Demo shows one example of this conversion happening: var cartesian = viewer.scene.pickPosition( ... ); if (cartesian) { var ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@emackey
I’m not sure that the ‘jittering’ in your animation is due to the
pickPositionresults . On my machine, If I seteyeOffset.zto a fixed value this doesn’t happen.I think it’s worth adding
scene.globe.depthTestAgainstTerrain = true;to the code in your comment, because this is not the default in the sandcastle.pickPositionreturns different values on terrain ifdepthTestAgainstTerrain == false, usually below the ellipsoid surface (maybe of theDepthPlane).The
Altstring in this example code is truncated so it shows an wrong height. for example:-143976.41485355987becomes3976.41.In looking at this while debugging #4855, I saw a case where I had only a single frustum, and yet the position returned by
pickPositionwas wildly wrong. For example, values inpickGlobeinScreenSpaceCameraController.js:That’s without anything in the scene except for the globe (and sun and moon and such I suppose, but not explicitly-added primitives).
So I don’t think it’s necessarily multi-frustum related.