Scene pickFromRayMostDetailed & pickPositionFromRay availability

Hello, I am wondering if there are any plans as to when we might see the above mentioned functions added to the public API? Thanks in advance.

Welcome to the Cesium community Josh!

Can you tell us a bit more about your project and use case?

Hey Omar, it’s Josh from - we have spoken a fair bit in the past but I think I created a new account when joining the new forum :smile: We are looking to use these functions for translating picked points from images used to construct photogrammetric 3d-tiles to the equivalent point on the 3d-tiles.

1 Like

Ah yes, hi Josh!

This is definitely a common use case I think that we’d like to support. In your case, you already have the 2D images in the right location and orientation in 3D space? And so the user clicks on any point in the image, and you’re able to map that to the 3D model with the pickFromRay functions?

Yep, that is correct. We have a side by side view with an image on the RHS and the cesium canvas on the LHS. Right clicking on the image will pick the equivalent point on the 3d-tiles and display it with a coloured point. I have experimented with both pickFromRayMostDetailed and pickFromRay and whilst they work well, they occasionally pick a point a few metre short of the actual surface :thinking: I have replicated this behaviour on multiple tile sets - perhaps I should put a sandcastle together to demonstrate?

This would be very helpful! There’s a few useful code snippets in here I put together to make it faster to put together these Sandcastles: How to share custom Sandcastle examples - #2 by omar.

Hi Omar, I tried to put together a simplified sandcastle of this today but have been unable to replicate it in that environment as of yet… A few additional details:

  • we are now using the latest version of cesium
  • 95% of the time pickFromRayMostDetailed works as expected
  • 5% of the time pickFromRayMostDetailed returns a coordinate on the ray, but short of the tiles
  • all scene entities are excluded from pickFromRayMostDetailed to ensure it is only picking the 3d tiles

The screenshot below contains a polyline which represents the same ray used in pickFromRayMostDetailed (for debugging purposes). The grey/orange point is added to the scene at the coordinate determined by pickFromRayMostDetailed.

I’ll keep working towards a sharable demonstration, but in the meantime if you have any thoughts I am all ears. Thanks you!

Are you using the default width for the pickFromRayMostDetailed call? The default is 0.1. I’m curious what effect a slightly larger or smaller value has.

Any other ideas @sean_lilley about what could be causing pickFromRayMostDetailed to be a few meters off as shown above, only sometimes?

@josh0 are you using master or 1.72?

pickFromRay accuracy has gotten much better since these two PRs were merged

Also more information in

What hardware are you running on?

@sean_lilley @Omar thanks for your input.

I previously mentioned that we were running 1.72 however due to several obscurities with our application this wasn’t actually the case. We are now actually running v1.72 and pickFromRayMostDetailed seems to be working as expected which explains why I was unable to replicate it in the Sandcastle. I’ll keep an eye on the mentioned PRs and report back if I experience any issues moving forwards. Thanks again for your assistance.


Hey @josh0 could you share an example of your sandcastle, I’ve also been trying to do this and I’d really appreciate it!