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 clamping Vector 3D Tile point features to Terrain or 3d Tiles #11710

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

gdiehlEB
Copy link

@gdiehlEB gdiehlEB commented Dec 19, 2023

Fixes Issue #11544

Adds the global heightReference member as an option for Cesium3DTileset to support clamping Billboards and Labels of Vector 3D Tiles point features to Terrain or 3D Tiles.

TO-DO:

  • I have submitted a Contributor License Agreement
  • I have added my name to CONTRIBUTORS.md
  • I have updated CHANGES.md with a short summary of my change
  • I have added or updated unit tests to ensure consistent code coverage
  • I have update the inline documentation, and included code examples where relevant
  • Review and revise inline documentation
  • I have performed a self-review of my code

@gdiehlEB
Copy link
Author

@ggetz when you have time can you provide some feedback for this implementation? Thanks again for all of your help.

@ggetz
Copy link
Contributor

ggetz commented Jan 2, 2024

Thanks @gdiehlEB, we'll do so shortly!

@ggetz
Copy link
Contributor

ggetz commented Jan 3, 2024

@gdiehlEB Before we can review the code here, you'll need to have Contributor License Agreement covering you or the organization you are contributing on behalf of. Please ask EB to submit one and that you are listed on it.

@gdiehlEB
Copy link
Author

gdiehlEB commented Jan 9, 2024

@gdiehlEB Before we can review the code here, you'll need to have Contributor License Agreement covering you or the organization you are contributing on behalf of. Please ask EB to submit one and that you are listed on it.

@ggetz the corporate CLA has been submitted.

@ggetz
Copy link
Contributor

ggetz commented Jan 17, 2024

Thanks @gdiehlEB!

We can test this out more properly once #11604 has been merged into main.

In the meantime, I don't think it's ideal to pass in scene from the top-level of Cesium3DTileset. I wonder if there is a way we can pass that in at a lower level instead.

@gdiehlEB
Copy link
Author

gdiehlEB commented Jan 19, 2024

Thanks for the feedback @ggetz! I had the same thought and have been looking for an alternative to passing the scene in, but I couldn’t find anywhere that the viewer instance was already available to access. If the heightReference is just set when creating the Cesium3DTileset instance similar to classificationType that seemed like the place to pass in the scene ie:

const tileset = await Cesium.Cesium3DTileset.fromUrl('/Apps/SampleData/lineworks/vector-tile.json', {
//clamp polylines
  classificationType: Cesium.ClassificationType.TERRAIN,
//clamp point features
  heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
//not ideal
  scene: viewer.scene
});

There may be another way that I am missing though. I saw that in the clamping sandcastle the Entity API is used and provides access to the viewer so no clues there.

@gdiehlEB gdiehlEB marked this pull request as ready for review March 26, 2024 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants