title: Rotate orthographic camera (shadow camera) in Three.js
body: <p>I'm trying to rotate a shadow camera by 45 degrees. I've managed to rotate the directional light it's attached to using the following code:</p>
  
  <pre><code>sunlight = new THREE.DirectionalLight(0xffffff, 1);
  sunlight.position.x = -camera.position.x ;
  sunlight.position.y = 300;
  sunlight.position.z = camera.position.z ; //default; light shining from top
  
  var vector = new THREE.Vector3;
  vector.subVectors(scene.position, sunlight.position);
  var q = new THREE.Quaternion();
  q.setFromAxisAngle( vector.normalize(), Math.PI / 4 );
  sunlight.applyQuaternion( q );
  </code></pre>
  
  <p>However the shadow camera does not rotate with the light as I'd expected. Trying to rotate the shadow camera itself using the same code does not work. How do I rotate an orthographic camera around its center point?</p>
  
  <p>In the attached image the shadow camera can be seen as the orange square. The light is the black square, seen rotated 45 degrees. I need to apply the same rotation to the orange square as well, so the blue arrow is pointing north west.</p>
  
  <p><a href="https://i.stack.imgur.com/u52CS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/u52CS.png" alt="enter image description here"></a></p>
  
  <p>Thanks in advance.</p>