CesiumGS / CesiumGS/cesium

ClippingPlane coordinate system in 3DTilesets

Open
#12,359 1 comment 0 reactions 0 assignees View on GitHub
category - architecture / api category - doc type - enhancement
Dominant language
JavaScript
Stars
15.7k
Forks
3.9k
Avg merge
4d 6h
Merged PRs (30d)
34

Description

### 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
}
);
`

Contributor guide

Open the contributing guide

Research direction

Start with Cesium3DTileset.fromUrl, the tileset clipping origin matrix, and the ClippingPlaneCollection documentation described in the issue. Determine whether the preferred origin should be configurable at creation or documented through modelMatrix usage. Done means the chosen API or documentation path supports a client-defined clipping origin and is clear to use.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
computer-graphics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.