drawWall(potArray: any) { const { viewer } = this; var minHeights = []; var maxHeights = []; var minH2: Array<any> = []; let arr = []; var minH3 = []; for (var i = 0; i < potArray.length; i++) { let c3 = potArray[i] var ellipsoid = viewer.scene.globe.ellipsoid; var cartographic = ellipsoid.cartesianToCartographic(c3); var lat = Cesium.Math.toDegrees(cartographic.latitude); var lng = Cesium.Math.toDegrees(cartographic.longitude); var alt = cartographic.height; arr.push(lng, lat, alt) } arr.push(arr[0], arr[1], arr[2]) for (var i = 0; i < arr.length / 3; i++) { minHeights.push(Math.floor(arr[i * 3 + 2])); if (minH2[i - 1] && Math.floor(arr[i * 3 + 2]) !== minH2[i - 1]) { minH2[i] = minH2[i - 1]; } else { minH2[i] = Math.floor(arr[i * 3 + 2]) } } for (var i = 0; i < arr.length / 3; i++) { maxHeights.push(arr[i * 3 + 2] + 20) } var wall_2 = viewer.entities.add({ wall: { positions: new Cesium.Cartesian3.fromDegreesArrayHeights(arr), minimumHeights: minHeights, maximumHeights: minHeights, material: Cesium.Color.YELLOW.withAlpha(0.3) } }); var wall_3 = viewer.entities.add({ wall: { positions: new Cesium.Cartesian3.fromDegreesArrayHeights(arr), minimumHeights: minHeights, maximumHeights: new Cesium.CallbackProperty(function () { for (var i = 0; i < minH2.length; i++) { minH2[i] += 0.1; if (minH2[i] >= 20) { minH2[i] = 0.1; } } return minH2; }, false), material: Cesium.Color.YELLOW.withAlpha(0.3) } }); }
正文
Cesium流动墙_立体墙
文章版权声明:除非注明,否则均为
譬如朝露_策温技术开发工作室博客原创文章,转载或复制请以超链接形式并注明出处。
发表评论
侧栏公告
寄语
譬如朝露博客是一个分享前端知识的网站,联系方式11523518。
热评文章
标签列表
热门文章
友情链接