3d Model per instance clipping

Hi,

In my project, I have a point cloud and load in position markers (positions where a scan for the point cloud was taken). The markers are gltf models i load using Model.fromGltfAsync. Depending on the project, we usually have between 20 and 1000 of those markers.

I have a functionality to apply a clipping box to the tileset (the point cloud in this case). I also applied this clipping box to the scan markers when calling Model.fromGltfAsync. The same .glb file is used for all of them, but each marker calls Model.fromGltfAsync itself.

This does not work properly. I assume that Cesium instances the models under the hood, because this is the behavior I see: there is one ‘original’ marker. If it falls into the clipping box, all markers are shown. If half of it is being clipped away, half of every single marker is clipped away, regardless of whether the individual markers are inside or outside the clipping box. If the ‘original’ marker is outside the box, all markers clipped away.

My question is, is there a way to apply a clipping plane collection that works on a per instance basis?

Best regards,
Daniel

Hi @DanRiess,

Thank you for your post and for being part of the Cesium community.

This sounds like a potential issue that we should investigate further. To help get that started, could you possibly provide example code using our sandcastle tool https://sandcastle.cesium.com/ that reproduces the error? This will help us understand exactly how you are using the API and whether there is a better approach that will resolve the issue or if there is a problem we need to investigate.

Thanks and I hope we can resolve this shortly.

Luke

Hey Luke,

when I created the sandcastle, I realized my error. I applied the tileset clipping plane collection to the models as is. I needed to apply a MM to the collection on the models that takes the current model’s translation into account. In my case, it was M_model_inverse x M_tileset. After doing that, everything now works as expected.

1 Like