CesiumGS / CesiumGS/cesium

scene.pick get wrong result at same position

Open
#9,561 9 comments 0 reactions 0 assignees View on GitHub
category - picking type - bug
Dominant language
JavaScript
Stars
15.7k
Forks
3.9k
Avg merge
4d 6h
Merged PRs (30d)
34

Description

I‘m trying to get entity by scene.pick。 I found that sometimes it get wrong result.
i use code like:
`
setInputAction(function(event) {
console.log(event.position)
let model = viewer.scene.pick(event.position);
if (model && model.id) {
console.log(model.id.id)
}
}, ScreenSpaceEventType.LEFT_DOWN)
`
In the map, i clicked green position three times
![image](https://user-images.githubusercontent.com/26835387/119228380-577ed700-bb45-11eb-9da3-10cae092aa5c.png)

then i got three different entity:
![image](https://user-images.githubusercontent.com/26835387/119228280-d8899e80-bb44-11eb-8c6e-b607b0b36de5.png)

Is there something I did wrong?

Contributor guide

Open the contributing guide

Research direction

Start with the reported viewer.scene.pick call inside setInputAction for ScreenSpaceEventType.LEFT_DOWN, using the supplied event-position logging and screenshots as the reproduction basis. Investigate why repeated clicks at the same visible position return different entities, and establish whether the behavior is reproducible and what result should be considered correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.