title: AFRAME screen to world position
body: <p>I'm trying to convert Mouse position to world coordinates in Three via Aframe</p>
  
  <p>Using something like </p>
  
  <pre><code>let mouse = new three.Vector2()
  let camera = document.querySelector('#camera')
  let rect = document.querySelector('#sceneContainer').getBoundingClientRect()
  mouse.x = ( (event.clientX - rect.left) / rect.width ) * 2 - 1
  mouse.y = - ( (event.clientY - rect.top) / rect.height ) * 2 + 1
  
  let vector = new three.Vector3( mouse.x, mouse.y, -1 ).unproject( camera )
  </code></pre>
  
  <p>However it doesn't seem to be able to handle the camera, I get</p>
  
  <blockquote>
    <p>TypeError: Cannot read property 'elements' of undefined</p>
  </blockquote>
  
  <p>From  Matrix4.getInverse </p>
  
  <pre><code>9550 | 
   9551 | // based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm
    9552 | var te = this.elements,
  &gt; 9553 |    me = m.elements,
    9554 | 
    9555 |    n11 = me[ 0 ], n21 = me[ 1 ], n31 = me[ 2 ], n41 = me[ 3 ],
    9556 |    n12 = me[ 4 ], n22 = me[ 5 ], n32 = me[ 6 ], n42 = me[ 7 ],
  </code></pre>
  
  <p>I presume it's not reading the camera properly, any ideas on how to get the three camera out of the aframe camera if that's the problem?</p>