根据沙盒例子做的3d tiles的平面剪切
var tileset;
var viewModel = {
debugBoundingVolumesEnabled : false,
edgeStylingEnabled : true,
// exampleTypes : clipObjects,
// currentExampleType : clipObjects[0]
};
function loadTileset(url) {
clippingPlanes = new Cesium.ClippingPlaneCollection({
planes : [
new Cesium.ClippingPlane(new Cesium.Cartesian3(0.0, 0.0, -1.0), 0.0)
],
edgeWidth : viewModel.edgeStylingEnabled ? 1.0 : 0.0
});
tileset = viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
url : url,
destination : Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706, 1000.0),
clippingPlanes : clippingPlanes
}));
//缩放视角
function zoomToTileset() {
boundingSphere = tileset.boundingSphere;
viewer.camera.viewBoundingSphere(boundingSphere, new Cesium.HeadingPitchRange(1, -0.5, 600)