Scene.pick and obtaining position of picked entity

Hi,

I am using the last version of cesium with the GeoAdmin Terrain with 3D tiles as in this code pen.

I am trying to pick an object (i.e., a 3D building in this case) using scene.pick.

If I follow the example in the sandbox to pick a feature it works fina and I am able — for example — to change the color of the hovered entity.

For further queries, however, I need to get the position (i.e., the center of the bounding box) of the picked entity/feature.

I tried in many ways, but I did not succeed. Is there any known solution for this? Should I use scene.pickPosition or is there any other way to accomplish this? I was expecting a way to get the position of the pickedFeature directly.

Best regards and thanks in advance!

Roberto

It isn’t possible to get the position or bounding volume of the feature, but yeah, you can use scene.pickPosition to get the exact location where the mouse picked.

Thank you Sean.

I find it strange that I cannot get the bounding volume of the feature but I can change its color :S

scene.pickPosition returns the position where the mouse picked, thus, in case I pick a feature (say, a building) I get a position that ‘touches’ one of the walls of the picked building. Am I right?

Best,
R

So, you all confirm that — besides using scene.pickPosition and obtain the position where the mouse picked — there is no way to access the bounding volume of the picked feature.

I need to check whether a given point is inside the bounding volume of the picked feature. Is there any known way to achieve this?

Cheers and thanks in advance,

Roberto

The Cesium3DTileset feature does not have the underlying model information tied to the object. So no, there is currently no way to retrieve the model itself from a pick that I’m aware of.

Roberto - keep an eye on https://github.com/AnalyticalGraphicsInc/3d-tiles/issues/127.

The bounding volume information would have to be embedded in the tile in some way - it is not easy to synthesize at runtime right now.

Thank you, I am following the issue now.

To me it looks strange only because I can easily invoke .color and change the color of the feature, but I cannot retrieve, say, its geometry.

Best,

Roberto

Yeah, geometry is tougher because we offload that to GPU memory so its not easily accessible, whereas colors are stored on the CPU and updated on the GPU as textures. It’s a different kind of problem.

Sean,

Is there anyway to get the surface normal of the picked position?

-DC

Sorry I missed your other thread, I responded to this here:

https://groups.google.com/d/msg/cesium-dev/RyK1q3jdfgo/_7-togSbAQAJ