title: Detect clicked object in THREE.js
body: <p>I have a THREE.js scene where a lot of elements appear, and I need to detect what object the user is clicking on.</p>
  
  <p>What I have done so far is the following. The camera does not move to much - it only changes the vertical position by a limited amount, always looking towards the same point. My approximate method is the following:</p>
  
  <ul>
  <li>I take the coordinates if the click relative to the canvas</li>
  <li>I translate them into horizontal and vertical coordinates in the webGL scene by means of a simple rescaling, and add a Z coordinate which is sufficiently far away.</li>
  <li>I take a horizontal ray starting from the point above, constructed by THREE.Ray()</li>
  <li>I use ray.intersectObjects() to find the first element along the ray.</li>
  </ul>
  
  <p>This method approximately works, but it is sometimes a few pixels away from the actual point.</p>
  
  <blockquote>
    <p>Is there a more reliable technique to find out the object where a user has clicked?</p>
  </blockquote>