我在2点之间的球体上画弧线有些麻烦。 我的方法是:
我的功能是:
// compute angle between p1 and p2
var angle = Math.acos(p1.dot(p2)/(p1.length()*p2.length()));
// create arc
var geometry = new THREE.CircleGeometry(earthRadius, earthBands, 0, angle);
// remove center vertex
geometry.vertices.splice(0,1);
// rotate around x axis
geometry.applyMatrix(new THREE.Matrix4().makeRotationX(Math.atan((p2.z-p1.z) / (p2.y-p1.y))));
// rotate around z axis
geometry.applyMatrix(new THREE.Matrix4().makeRotationZ(-Math.atan(p1.y / p1.x)));
// rotate around y axis
geometry.applyMatrix(new THREE.Matrix4().makeRotationY(Math.atan(p1.z / p1.y)));
在球体上绘制圆弧是一种好方法吗? 为什么圆弧没有正确旋转?