threejs 中 如何将 经纬度 转为 模型在场景中的坐标? 就像这样的坐标点 x, y,z ; // mesh.position.set ( x, y ,z )
lglt2xyz(lng, lat, radius) {
const theta = (lng + 90) * (Math.PI / 180)
const phi = (90 - lat) * (Math.PI / 180)
spherical.phi = phi; // phi是方位面(水平面)内的角度,范围0~360度
spherical.theta = theta; // theta是俯仰面(竖直面)内的角度,范围0~180度
let position = new THREE.Vector3()
position.setFromSpherical(spherical)
return position
},
本人都是查到的是这样的,后台返回的经纬度可能很相近, 但是我将经纬度转换后, position 的值都非常相近 , 跟经纬度在场景中的位置差很多
求解答。不胜感谢!