title: three.js Raycaster intersectObjects
body: <p>I'm trying to modify <a href="https://github.com/timoxley/threejs/blob/master/examples/webgl_morphtargets_md2_control.html" rel="nofollow">this example</a> from three.js to control the character(s) with mouse clicks.  First, when I click on the canvas, I need the mouse coordinates and convert that into 3D space coordinates using THREE.Raycaster.intersectObjects.  In the modified code, on left mouse up, I have the following: </p>
  
  <pre><code>var vector = new THREE.Vector3((event.clientX / window.innerWidth) * 2 - 1, -(event.clientY / window.innerHeight) * 2 + 1, 0.5);
  var projector = new THREE.Projector();
  projector.unprojectVector(vector, camera);
  
  var raycaster = new THREE.Raycaster(camera.position, vector.sub(camera.position).normalize());
  
  var intersects = raycaster.intersectObjects(objects);
  
  if (intersects.length &gt; 0) {
      console.log('intersect: ' + intersects[0].point.x.toFixed(2) + ', ' + intersects[0].point.y.toFixed(2) + ', ' + intersects[0].point.z.toFixed(2) + ')');
  }
  else {
      console.log('no intersect');
  }
  </code></pre>
  
  <p>I have added the ground mesh to the <code>objects</code> array, but <code>raycaster.intersectObjects</code> still returns empty array when I click on the ground mesh.  I also tried passing in <code>scene.children</code> instead of <code>objects</code>, but no luck.  </p>
  
  <p>Here is the <a href="https://gist.github.com/anonymous/5225890" rel="nofollow">full modified source</a>.</p>