So ordnen Sie Breiten- und Längengrade einer 3D-Kugel zu
Versuche, Koordinaten mit Breiten- und Längengrad auf eine 3D-Kugel abzubilden.
Ich habe drei verschiedene Gleichungen aus dem Internet ausprobiert und keine davon funktioniert. Weiß jemand, wie es geht.
Dies sind diejenigen, die ich ausprobiert habe und die nicht funktioniert haben.
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);