Open gdiehlEB opened 9 months ago
Hi @gdiehlEB, thanks for the request!
I believe this is a duplicate of https://github.com/CesiumGS/cesium/issues/6714. I'm going to close this issue and add your a link to your writeup there to keep conversation in one place. Thanks!
@ggetz While testing the implementation from my draft PR with the new heightReference options, I found clamping to a 3D tile works if the 3d Tile is added directly to viewer.scene.primitives
but not if it is added via a PrimitiveCollection.
So setting heightReference.CLAMP_TO_3D_TILE
will clamp a point, etc to tileset
in this case:
const tileset = await Cesium.Cesium3DTileset.fromUrl('/Apps/SampleData/b3dmTileset.json', {
});
viewer.scene.primitives.add(tileset);
but not in this case:
const tileset = await Cesium.Cesium3DTileset.fromUrl('/Apps/SampleData/b3dmTileset.json', {
});
const collection = new Cesium.PrimitiveCollection();
collection.add(tileset);
viewer.scene.primitives.add(collection);
This is something I'd like to add support for as part of this issue. Do you have any thoughts as to what that would entail, any pitfalls, etc? I am familarizing myself with both of your recent PRs to get a better understanding but figure you might have some good insight.
This is something I'd like to add support for as part of this issue.
Will open a 2nd PR separate from #11710 to support clamping to tilesets within hierarchies of Primitives.
Summary:
As stated in the docs, the
classificationType
option forCesium3dTileset
currently ‘... is not supported for points or instanced 3D models.’When used to create tilesets consisting of both line and points entities the classification only applies to the line entities and not the points.
Example:
Cesium3DTileset.fromUrl
can be used to create an instance consisting of lines and labelled points in a Cesium viewer, and providing the optionclassificationType: Cesium.ClassificationType.TERRAIN
will clamp the lines entities to the terrain but not the points.Example code:
Result: Linework entities are clamped to terrain with points floating above.
Request:
Provide classification support for points, in order to enable clamping of instances that consist of both lines and points entities to terrain or other 3d tilesets by providing the
classificationType
option withCesium.ClassificationType.TERRAIN
orCesium.ClassificationType.CESIUM_3D_TILES
values.