1

Mathematically I computed the orthogonal matrix for the rotation that I want to apply to the camera. Before that I successfully applied a rotation on a axis. Perhaps the solution is to transform Matrix3 to Matrix4 and then apply it to the camera somehow.

  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();
1

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.