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

ClippingPlane coordinate system in 3DTilesets #12359

Open
runeaasgaard opened this issue Dec 5, 2024 · 0 comments
Open

ClippingPlane coordinate system in 3DTilesets #12359

runeaasgaard opened this issue Dec 5, 2024 · 0 comments

Comments

@runeaasgaard
Copy link

Feature

As it is today the origin of the ClippingPlane coordinate system for a 3DTileset is set from the center of the boundingsphere of the root tile of the tileset. For a large tileset this can be a rather arbitrary point, not easily related to the individual objects in the tileset and not well known to the client.

The tileset clipping origin transform is also only accessible trough a private and undocumented property of the tileset, and the only way I have found to use my_preferred_clipping_origin_matrix is to set the clipping plane collection modelMatrix to the difference between my matrix and the tileset clippingPlanesOriginMatrix like this:
const scratch_invert = Matrix4(); Cesium.Matrix4.inverse(tileset.clippingPlanesOriginMatrix, scratch_invert); Cesium.Matrix4.multiply(scratch_invert, my_preferred_clipping_origin_matrix, tileset.clippingPlanes.modelMatrix);

If there is a better way I would have liked an example in the ClippingPlaneCollection documentation. If not, I would have liked a possibility to set the tileset clippingPlanesOriginMatrix on tileset creation, using the root tile origin only when this is not provided.
let tileset = await Cesium.Cesium3DTileset.fromUrl( my_tileset_urll, { dynamicScreenSpaceError: true, clippingPlanesOriginMatrix: Matrix4.IDENTITY } );

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

1 participant