Hi, I was hoping to ask for assistance, we are trying to clip the tileset base on the center of a line. It is working fine with the terrain but with tileset it seems to be not working.
Whenever I try to set the center position using modelMatrix the tileset is disappearing but for the terrain it is working fine
Here is the image:
Here is the code:
let angleOffset = Cesium.Math.toRadians(40);
let planeRotation1 = angleOffset;
let planeRotation2 = angleOffset + Cesium.Math.toRadians(90);
let distance_plane = distance;
let testPlanes2 = new Cesium.ClippingPlaneCollection({
planes: [
new Cesium.ClippingPlane(
new Cesium.Cartesian3(
Math.cos(planeRotation1),
Math.sin(planeRotation1),
0.0
),
distance_plane
),
new Cesium.ClippingPlane(
new Cesium.Cartesian3(-Math.cos(planeRotation1), -Math.sin(planeRotation1),
0.0
),
distance_plane
),
new Cesium.ClippingPlane(
new Cesium.Cartesian3(
Math.cos(planeRotation2),
Math.sin(planeRotation2),
0.0
),
distance_plane
),
new Cesium.ClippingPlane(
new Cesium.Cartesian3(-Math.cos(planeRotation2), -Math.sin(planeRotation2),
0.0
),
distance_plane
),
new Cesium.ClippingPlane(
new Cesium.Cartesian3(
0,
0,
1
),
distance_plane * 0.1
), new Cesium.ClippingPlane(
new Cesium.Cartesian3(
0,
0, -1
),
distance_plane * 1.5
),
],
enabled: true,
unionClippingRegions: true,
edgeWidth: 3.0,
edgeColor: Cesium.Color.RED,
modelMatrix: Cesium.Transforms.eastNorthUpToFixedFrame(centerPosition)
});
let testPlanes3 = new Cesium.ClippingPlaneCollection({
planes: [
new Cesium.ClippingPlane(
new Cesium.Cartesian3(
Math.cos(planeRotation1),
Math.sin(planeRotation1),
0.0
),
distance_plane
),
new Cesium.ClippingPlane(
new Cesium.Cartesian3(-Math.cos(planeRotation1), -Math.sin(planeRotation1),
0.0
),
distance_plane
),
new Cesium.ClippingPlane(
new Cesium.Cartesian3(
Math.cos(planeRotation2),
Math.sin(planeRotation2),
0.0
),
distance_plane
),
new Cesium.ClippingPlane(
new Cesium.Cartesian3(-Math.cos(planeRotation2), -Math.sin(planeRotation2),
0.0
),
distance_plane
),
new Cesium.ClippingPlane(
new Cesium.Cartesian3(
0,
0,
1
),
distance_plane * 0.1
), new Cesium.ClippingPlane(
new Cesium.Cartesian3(
0,
0, -1
),
distance_plane * 1.5
),
],
enabled: true,
unionClippingRegions: true,
edgeWidth: 3.0,
edgeColor: Cesium.Color.RED,
modelMatrix: Cesium.Transforms.eastNorthUpToFixedFrame(centerPosition)
});
globe.backFaceCulling = false;
globe.showSkirts = true;
globe.clippingPlanes = testPlanes2;
tileset.clippingPlanes = testPlanes3;