Getting mesh intersection on BatchedModel (3DTiles)

I am probably missing something very obvious here, but I don’t seem to be able to get the position of a model I have clicked on in a 3D Tile set.

Is there some trick with getProperties I am missing, or is this still in development?

I can see the BatchedModel, its ID, change colour, and see the entire Cesium3DTileset (and its lat / long bounds), but what I want to do is intersect with the individual building I have picked, and then get the lat, long of its centre point on the ground.

Any help appreciated.

Kind regards,

Stephen

Hi Stephen,

Try using scene.pickPosition, like this Sandcastle example: Cesium Demo

That returns the actual position picked. If you want to return the center of the building, store it in the batch table of each tile, then use scene.pick to get the picked batched model, e.g., see

https://github.com/AnalyticalGraphicsInc/cesium/blob/3d-tiles/Apps/Sandcastle/gallery/Cities.html#L124-L140

Finally, use getProperty to return the center:

https://github.com/AnalyticalGraphicsInc/cesium/blob/3d-tiles/Source/Scene/BatchedModel.js#L58-L67

By the way, what are you building with 3D Tiles? Please consider submitting a talk proposal to FOSS4G NA as I mentioned in the 3D Tiles thread.

Patrick

Hi Patrick,

Thanks, that’s helpful. And yes, thanks for the recommendation to add it to the model run. In our next export that is the plan.

This is us… http://www.cityzenith.com

Time allowing we’d love to attend FOSS4G, as well as submit something for consideration. We are discussing what’s possible internally atm.

Kind regards,

Stephen