教程示例网站:https://thomaz529.github.io
一、效果图
二、代码
Cesium提供了线性插值的方法Cesium.Math.lerp,不仅仅可以为经纬度进行插值,也可以对颜色,等高线等进行插值计算。
const length = 100;
const startLon = 100
const endLon = 120
const lat = 34
const a = Cesium.Cartesian3.fromDegrees(100, 34)
const b = Cesium.Cartesian3.fromDegrees(120, 34)
const terrainSamplePositions = [];
for (let i = 0; i < length; ++i) {
const lon = Cesium.Math.lerp(
endLon,
startLon,
i / (length - 1)
);
const position = Cesium.Cartesian3.fromDegree
标签:教程,const,Cartesian3,线性插值,34,length,Cesium,100
From: https://blog.csdn.net/weixin_43976807/article/details/144752952