cesium绘制折线_三维模型-折线样式变抛物线

let pointOrigin = [121.17350996561925, 27.984984352627176, 50];

let point1 = [121.17307188929195, 27.98470330215371, 27]

let dashedLine = this.viewer.entities.add({

name: 'Blue dashed line',

polyline: {

positions: Cesium.Cartesian3.fromDegreesArrayHeights([...pointOrigin, ...point1]),

width: 2,

arcType: Cesium.ArcType.RHUMB,

// hMax: 5000,

material: new Cesium.PolylineDashMaterialProperty({

color: Cesium.Color.WHITE

})

}

});

问题1、看了官网实例,描绘出来是2点线段呈抛物线。我这个代码画出来笔直笔直的,跟arcType有关嘛,还是2点直接的高度差太低了

问题2、hMax的意思是啥。

实际效果如下

想实现的效果 是 根据一个初始点 以抛物线的形式描绘出来折线

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
实现Cesium三维漫游飞行效果可以通过以下步骤实现: 1. 创建一个Cesium Viewer对象: ``` var viewer = new Cesium.Viewer('cesiumContainer'); ``` 2. 通过Camera控制视角和位置: ``` viewer.camera.setView({ destination: Cesium.Cartesian3.fromDegrees(longitude, latitude, height), orientation: { heading: Cesium.Math.toRadians(heading), pitch: Cesium.Math.toRadians(pitch), roll: Cesium.Math.toRadians(roll) } }); ``` 3. 为视角添加动画效果: ``` var duration = 5.0; // 动画时间,单位为秒 Cesium.CameraFlightPath.createAnimationCartographic(viewer.scene, { destination: Cesium.Cartographic.fromDegrees(longitude, latitude, height), orientation: { heading: Cesium.Math.toRadians(heading), pitch: Cesium.Math.toRadians(pitch), roll: Cesium.Math.toRadians(roll) }, duration: duration }); ``` 4. 添加键盘和鼠标事件: ``` // 飞行到指定位置 function flyTo(longitude, latitude, height, heading, pitch, roll) { viewer.camera.flyTo({ destination: Cesium.Cartesian3.fromDegrees(longitude, latitude, height), orientation: { heading: Cesium.Math.toRadians(heading), pitch: Cesium.Math.toRadians(pitch), roll: Cesium.Math.toRadians(roll) } }); } // 监听键盘和鼠标事件 document.addEventListener('keydown', function(event) { switch (event.keyCode) { case 87: // W viewer.camera.moveForward(1000.0); break; case 83: // S viewer.camera.moveBackward(1000.0); break; case 65: // A viewer.camera.moveLeft(1000.0); break; case 68: // D viewer.camera.moveRight(1000.0); break; case 38: // Up arrow viewer.camera.lookUp(0.1); break; case 40: // Down arrow viewer.camera.lookDown(0.1); break; case 37: // Left arrow viewer.camera.lookLeft(0.1); break; case 39: // Right arrow viewer.camera.lookRight(0.1); break; default: return; } event.preventDefault(); }, false); ``` 通过以上步骤,即可实现Cesium三维漫游飞行效果。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值