interpolation(pos1, pos2) { let po1 = pos1 let po2 = pos2 this.getPositionwkt(po1, po2).then((res) => { this.$config.viewer.scene.clampToHeightMostDetailed(res).then((clampedCartesians) => {//异步获取当前位置的3d对象 showPath = showPath.concat(clampedCartesians) // pathIndex++ maxIndex = showPath.length // linePath = clampedCartesians; }) }) }, getPositionwkt(startP, endP) {//等分线,返回点的数组 return new Promise(resolve => { var count = 30; var cartesians = new Array(count); for (var i = 0; i < count; ++i) { var offset = i / (count - 1); cartesians[i] = Cesium.Cartesian3.lerp( startP, endP, offset, new Cesium.Cartesian3() ); } resolve(cartesians); }) },
标签:count,cartesians,模型,var,cesium,new,clampedCartesians,showPath,线切割 From: https://www.cnblogs.com/wangkt/p/17839416.html