Cesium Box - terrain excavation (with source code download)

Cesium


Cesium is designed for three-dimensional map of the Earth and world-class open source JavaScript. It provides a development kit based on the JavaScript language, user-friendly Web applications to quickly build a zero Virtual Earth plug-in, and in performance, precision, and multi-platform rendering quality, ease of use have quality assurance.

About terrain excavation


Excavation terrain surface topography that is, a range of excavated area, for displaying the terrain scene, often used in distribution network, underground drains, trapway other underground facilities, underground construction or the like.

Renderings

Advance preview interface


Excavation and terrain-based interface cropping effect 3dtiles model used is the same, except that a different way. Still these interfaces.

  • ClippingPlaneCollection
  • ClippingPlane
  • Globe

Specific operations

1, initialize the earth, and turn depth test

var viewer = new Cesium.Viewer('cesiumContainer', {
imageryProvider: new Cesium.UrlTemplateImageryProvider({
url: 'http://www.google.cn/maps/vt?lyrs=s@716&x={x}&y={y}&z={z}'
}),
terrainProvider: Cesium.createWorldTerrain({
requestVertexNormals: true,
requestWaterMask: true
})
});
viewer.scene.globe.depthTestAgainstTerrain = true;

2、指定开挖位置,并设置开挖距离

var position = Cesium.Cartographic.toCartesian(new Cesium.Cartographic.fromDegrees(-113.2665534, 36.0939345, 100));
var distance = -3000.0; // 开挖距离

更多详情见小专栏GIS之家cesium小专栏

文章提供源码,对本专栏感兴趣的话,可以关注一波

Guess you like

Origin www.cnblogs.com/giserhome/p/11029020.html