在数学上我计算了我想要应用于相机的旋转的正交矩阵。在此之前,我成功地在轴上应用了旋转。也许解决方案是将Matrix3转换为Matrix4,然后以某种方式将其应用于相机。
camera = new THREE.PerspectiveCamera(150, window.innerWidth / window.innerHeight, 0.1, 5000);
camera.position.x = myParams.eye_x;
camera.position.y = myParams.eye_y;
camera.position.z = myParams.eye_z;
var m = new Matrix3();
m.set(
-cos(myParams.eye_deg2)*cos(myParams.eye_deg1),
sin(myParams.eye_deg2)*(Math.pow(cos(myParams.eye_deg1),2)-Math.pow(sin(myParams.eye_deg1),2)) ,
cos(myParams.eye_deg2)*sin(myParams.eye_deg1),
-sin(myParams.eye_deg2)*cos(myParams.eye_deg1),
cos(myParams.eye_deg2)*(Math.pow(sin(myParams.eye_deg1),2)-Math.pow(cos(myParams.eye_deg1),2)) ,
sin(myParams.eye_deg2)*sin(myParams.eye_deg1),
-sin(myParams.eye_deg1),
0,
cos(myParams.eye_deg1));
// camera.rotateOnAxis( pos_center.add(pos_camera.negate()).normalize(), -Math.PI / 2);
// >>>> to do: apply rotation matrix m to camera <<<<<
camera.updateProjectionMatrix();