title: ThreeJS - project/raycast mouse click to XZ plane
body: <p>I'm trying to implement offline routing in 3D map inside ThreeJS scene. I want user to click a point and then navigate a cube to this point. Navigation works correctly but clicked point isn't accurate. Flat map is a plane in XZ coordinates with Y axis up. In the scene I've got Orbit Controls which when orbiting change the position argument of camera, thus raycasting is not accurate with the way I'm doing it. I need to get correct XZ coords in whatever orbit state. I'm getting correct coords for traditional raycasting in 3D but as I said this is not what I need. I tried basic method from ThreeJS docs for raycaster, answer from <a href="https://stackoverflow.com/questions/32973060/converting-2d-mouse-coordinates-to-world-xz-coordinates-in-threejs">this question</a> and unprojecting mouse click with <code>Vector3.unproject()</code> without any success.</p>
  
  <p><a href="https://jsfiddle.net/e6b20xto/2/" rel="nofollow noreferrer">Here</a> is jsfiddle to illustrate what I mean. There are some important explanation comments.</p>