Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for vector tile points clamping #11544

Open
gdiehlEB opened this issue Sep 25, 2023 · 3 comments
Open

Add support for vector tile points clamping #11544

gdiehlEB opened this issue Sep 25, 2023 · 3 comments

Comments

@gdiehlEB
Copy link

Summary:

As stated in the docs, the classificationType option for Cesium3dTileset 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 option classificationType: Cesium.ClassificationType.TERRAIN will clamp the lines entities to the terrain but not the points.

Example code:

const viewer = new Cesium.Viewer("cesiumContainer");

//tileset consists of lines.vctr, points.vctr and tileset.json
const tileset = await Cesium.Cesium3DTileset.fromUrl('/Apps/SampleData/tileset.json', {
  classificationType: Cesium.ClassificationType.TERRAIN,
});

tileset.style = new Cesium.Cesium3DTileStyle({
  color: "rgb(255, 0, 0, 1)",
});

viewer.scene.primitives.add(tileset);
viewer.zoomTo(tileset);

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 with Cesium.ClassificationType.TERRAIN or Cesium.ClassificationType.CESIUM_3D_TILES values.

@ggetz
Copy link
Contributor

ggetz commented Sep 26, 2023

Hi @gdiehlEB, thanks for the request!

I believe this is a duplicate of #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 ggetz closed this as completed Sep 26, 2023
@ggetz ggetz reopened this Dec 6, 2023
@ggetz ggetz mentioned this issue Dec 7, 2023
4 tasks
@gdiehlEB gdiehlEB changed the title Add support for points to Cesium3DTileset option classificationType Add support for vector tile points clamping Dec 12, 2023
@gdiehlEB
Copy link
Author

gdiehlEB commented Mar 7, 2024

@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.

@gdiehlEB
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants