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

Entity Picking Bug #5402

Closed
jdfwarrior opened this issue Jun 1, 2017 · 10 comments · Fixed by #5496
Closed

Entity Picking Bug #5402

jdfwarrior opened this issue Jun 1, 2017 · 10 comments · Fixed by #5496

Comments

@jdfwarrior
Copy link
Contributor

A coworker was working on something and came across a weird issue when attempting to pick entities in Cesium. I've put together a little example here

I attempted to post this in the forums but they weren't showing up.

The basic idea is, we are using the mouse_move event to pick and see what entities are under the cursor and display a tooltip for that entity. The sandcastle example above does just that. We've come across a repeatable issue where Cesium doesn't correctly report the picked objects.

We found this in Cesium 1.32 I believe but have been able to reproduce it in the Sandcastle as well which I believe is currently at 1.33.

To reproduce the issue:

  1. Zoom in to the right of the ISS path polyline (the purple one)
  2. Adjust the camera angle downward (as low as possible) so that you're looking at the horizon. You should be below the polyline now
  3. Click, drag and rotate the globe to a point beyond the ISS polyline (now on the left side of it)
  4. Rotate the camera back around and look up at the ISS polyline
  5. Mouseover the polyline for the ISS

If the steps above are executed correctly, the tooltip won't be displayed. In testing, it appears that the entity isn't correctly picked. Our code we were testing with would console log the value of the variable that we stored the picked entity into and in this instance, it would return undefined.

Getting it to fail my take a few tries but it's something that we've definitely been able to replicate numerous times. Is this a known issue?

@hpinkos
Copy link
Contributor

hpinkos commented Jun 1, 2017

Thanks for the detailed explanation and the code example @jdfwarrior! We have seen some picking issues lately, but I wasn't able to reproduce the one you reported. Could you copy/paste a screenshot of what the camera angle looks like when picking stops working?
Also, what browser, OS and graphics card are you using? Thanks!

@jdfwarrior
Copy link
Contributor Author

Ok I just tried it again was able to replicate it a little easier this time. From the same link, double click on the ISS to track it. Click the globe to hide the info box then rotate under and back around to the top of the entity. At that point, the tooltip doesn't work. I know the tooltip isn't of your concern but the tooltip doesn't show when it found nothing to pick which seems to be the issue.

We did this in IE and Firefox (our IT team for some reason has bricked our ability to use Cesium in Chrome) on Windows 7 and graphics card is an NVIDIA Quadro K2200

@hpinkos
Copy link
Contributor

hpinkos commented Jun 1, 2017

Ah, thanks. I was able to reproduce this in IE. Most of us use Chrome for development so that's maybe why we haven't seen this.

This is what my view looked like when picking stopped working. I would pop in occasionally, but hovering over most of the line returned nothing

image

@hpbrew
Copy link

hpbrew commented Jun 1, 2017

Hey, I found this for @jdfwarrior.
I have noticed that if you resize the window it does start working again.
When it breaks sometimes the tooltip does show up in random places near the path. It seems like the calculation for pick is inaccurate.

We did this in a browser using IE to test the issue, but our typical environment is electron using chrome as the rendering engine where we originally encountered this issue. Thanks!

@hpinkos
Copy link
Contributor

hpinkos commented Jun 1, 2017

Thanks for the extra info @ChangeDotOrg!

@mramato
Copy link
Contributor

mramato commented Jun 1, 2017

I've actually ran into this a few times as well, but since I was on the 3D Tiles branch every time, I assumed it was specific to there. "good" to know it's in master. @bagnell can you take a look at this?

@thedoctordiaz
Copy link

I just wanted to confirm that there is a picking bug even with the simple sandcastle demo on cesiumjs.org that picks a single cesium billboard entity. If you zoom out the earth ball and spin it around a few times and then zoom back in, picking stops working correctly and the part of the screen that causes the billboard to highlight is no where near the icon visually. Likewise as was mentioned if you then resize the screen, picking will start working again.
I attached a screen shot showing the mouse over Africa selecting an entity over the USA.
cesium pick bug

@hpinkos
Copy link
Contributor

hpinkos commented Jun 13, 2017

Thanks for including the screenshot @thedoctordiaz! That should make it easier for us to reproduce what you are seeing. We're going to try to look into this soon.

@emackey
Copy link
Contributor

emackey commented Jun 16, 2017

Turns out this is caused by the Sun coming into view alongside the Earth. A fix is under review now, linked above.

@emackey
Copy link
Contributor

emackey commented Jun 19, 2017

This is fixed in master, and will be released with Cesium 1.35 on July 5th. demo

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.

7 participants