title: THREE JS get (world) rotation from matrixWorld
body: <p>How do I get the world rotation of an Object3D in three.js?
  I know how to get the world position of an Object3D from <code>object.matrixWorld</code>, but how do I get the world rotation of an object?</p>
  
  <p>I need this for the following problem: I have a hierarchical Object structure like this:</p>
  
  <pre><code>var obj1 = new THREE.Object3D();
  obj1.x = 200;
  obj1.rotation.x = 0.1;
  scene.add(obj1);
  
  var obj2 = new THREE.Object3D();
  obj2.y = -400;
  obj2.rotation.y = 0.21;
  obj1.add(obj2);
  
  var obj3 = new THREE.Object3D();
  obj3.z = -200;
  obj3.rotation.x = 0.1;
  obj3.rotation.y = -0.1;
  obj2.add(obj3);
  </code></pre>
  
  <p>Now I want to make my camera look at obj3 orthogonally in a certain distance. When My Objects are not rotated, this works like this:</p>
  
  <pre><code>var relativeCameraOffset = new THREE.Vector3(0, 0, 500); // 500 is z-distance from my object
  var cameraOffset = relativeCameraOffset.applyMatrix4(obj3.matrixWorld);
  camera.position = cameraOffset;
  </code></pre>
  
  <p>When only my last child is rotated I get what I want when I add this line</p>
  
  <pre><code>camera.rotation = obj3.rotation;
  </code></pre>
  
  <p>But when all parent Elements are rotated this is not working. So I'm looking for a way to get the world "orientation" of my 3D object.
  Thanks.</p>