在铯中,tileset上的剪切平面不起作用

时间:2018-11-15 09:59:17

标签: cesium

当我使用铯1.49时,可以在tileet上剪切平面。但是,当我将Cesium更新为1.50时,它无法在tileet上剪切平面。我该怎么办?

function clipplanes(dig_point){
console.log(dig_point);
var points = dig_point;

var pointsLength = points.length;

// Create center points for each clipping plane
var clippingPlanes = [];
for (var i = 0; i < pointsLength; ++i) {
    var nextIndex = (i + 1) % pointsLength;
    var midpoint = Cesium.Cartesian3.add(points[i], points[nextIndex], new Cesium.Cartesian3());
    midpoint = Cesium.Cartesian3.multiplyByScalar(midpoint, 0.5, midpoint);
    var up = Cesium.Cartesian3.normalize(midpoint, new Cesium.Cartesian3());
    var right = Cesium.Cartesian3.subtract(points[nextIndex], midpoint, new Cesium.Cartesian3());
    right = Cesium.Cartesian3.normalize(right, right);
    var normal = Cesium.Cartesian3.cross(right, up, new Cesium.Cartesian3());
    normal = Cesium.Cartesian3.normalize(normal, normal);
    // Compute distance by pretending the plane is at the origin
    var originCenteredPlane = new Cesium.Plane(normal, 0.0);
    var distance = Cesium.Plane.getPointDistance(originCenteredPlane, midpoint);
    clippingPlanes.push(new Cesium.ClippingPlane(normal, distance));
}
globe.clippingPlanes = new Cesium.ClippingPlaneCollection({
    planes : clippingPlanes,
    edgeColor: Cesium.Color.WHITE,
});
//3d tile挖洞
UAVtileset.clippingPlanes = new Cesium.ClippingPlaneCollection({
    planes : clippingPlanes,
    edgeColor: Cesium.Color.WHITE,
});

}

1 个答案:

答案 0 :(得分:1)

这是开发人员已知的问题:

https://github.com/AnalyticalGraphicsInc/cesium/issues/6600

,并在此处进行讨论:

https://groups.google.com/forum/#!topic/cesium-dev/V3HMRAqToeU

希望这会有所帮助。