【问题标题】:how to map latitude and longitude to a 3D Sphere如何将纬度和经度映射到 3D 球体
【发布时间】:2016-04-02 14:10:25
【问题描述】:

尝试将经纬度坐标映射到 3d 球体上。

我尝试了来自互联网的三组不同的方程式,但没有一个有效。有谁知道怎么做。

这些是我试过的,但没有用。

var phi   = (90-lat)*(Math.PI/180),
theta = (lon+180)*(Math.PI/180),
x = -((radius) * Math.sin(phi)*Math.cos(theta)),
z = ((radius) * Math.sin(phi)*Math.sin(theta)),
y = ((radius) * Math.cos(phi));

return new THREE.Vector3(x,y,z);


  var height = 600;
  var phi = (lat)*Math.PI/180;
  var theta = (lon-180)*Math.PI/180;

  var x = -(radius+height) * Math.cos(phi) * Math.cos(theta);
  var y = (radius+height) * Math.sin(phi);
  var z = (radius+height) * Math.cos(phi) * Math.sin(theta);

  return new THREE.Vector3(x,y,z);



 var x = Math.cos(lon) * Math.sin(lat),
     y = Math.sin(lon) * Math.sin(lat),
     z = Math.cos(lat);
 return  new THREE.Vector3(x,y,z);

【问题讨论】:

    标签: 3d three.js coordinates


    【解决方案1】:

    啊,实际上这个绝对有效!

    var phi   = (90-lat)*(Math.PI/180),
    theta = (lon+180)*(Math.PI/180),
    x = -((radius) * Math.sin(phi)*Math.cos(theta)),
    z = ((radius) * Math.sin(phi)*Math.sin(theta)),
    y = ((radius) * Math.cos(phi));
    
    return new THREE.Vector3(x,y,z);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-02-23
      • 1970-01-01
      • 1970-01-01
      • 2011-01-17
      • 1970-01-01
      • 2010-09-05
      • 1970-01-01
      • 2020-03-13
      相关资源
      最近更新 更多