Pick primitives / entities at Cartesian3 position

Is it possible to return a list of entities / primitives (e.g. vectors & 3dtiles) that occupy a position?

If I want to figure out the height for empty air to place labels etc, what’s the best way to go about this?

Hi Alex,

Yes, it’s possible to get a list of entities at some position using ‘drillPick’, as shown in this example: http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Picking.html&label=Showcases

However, picking is relatively costly, so if you need to determine where there’s empty space for a label, I would suggestion keeping trace of your entities using something like a tree dat structure.

Hope that helps,

  • Rachel

Hi Rachel,

I am aware of scene.DrillPick, however it takes a WindowPosition, not a Cartesian3 Position, so it's not very helpful.

I'm trying to draw labels on top of a 3D Tiles model, and sometimes vectors that have also been drawn in place. Picking from the mouse is not very helpful.

Is there any picking function that will take a standard Cartesian3?

Thank you for your response.

Alex

Hi Alex,

You can convert your Cartesian3 to screen space before picking: http://cesiumjs.org/Cesium/Build/Documentation/SceneTransforms.html?classFilter=sce#.wgs84ToDrawingBufferCoordinates

However note that this will only work if the Cart3 position is visible from your current camera position. Unfortunately, this is the only workable method we have right now.

Best,

  • Rachel

Thanks Rachel, that will work well for us! No point drawing something that’s not in view anyway.

Thanks for all your help!

Alex