cesium - 在 Cesium 中,tileset 上的 Clipping Planes 不起作用
问题描述
当我使用 Cesium 1.49 时,我可以在图块集上剪裁平面。但是当我将 Cesium 更新到 1.50 时,它无法在图块集上裁剪平面。我应该怎么做?
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,
});
}
解决方案
这是开发人员已知的问题:
https://github.com/AnalyticalGraphicsInc/cesium/issues/6600
也在这里讨论:
https://groups.google.com/forum/#!topic/cesium-dev/V3HMRAqToeU
希望这可以帮助。
推荐阅读
- c - 如何在不使用 WiFi 的情况下将数据从一个 ESP32 发送到另一个
- c# - 在 .NET Core 中使用 FluentValidation 和依赖注入
- eclipse - GWT hello world 应用程序无法编译并要求输入“com.google.gwt.core.Core”
- javascript - Axios 请求未接收到设置了 content-type 的 formData
- java - 按对象内的值过滤 RecyclerView
- flutter - Flutter 响应式设计:如果屏幕更大,动态将 Column 更改为 Row
- c# - 编写 CSV 文件 - 为列名添加前缀
- python - Python:用字符串调用函数返回参数的描述
- java - 数组声明是线性时间运算还是常数时间运算?
- wordpress - 如何使旧博客文章的新主页入口点