code: function unproject (out, vec, viewport, invProjectionView) {
    var viewX = viewport[0],
      viewY = viewport[1],
      viewWidth = viewport[2],
      viewHeight = viewport[3]
  
    var x = vec[0],
      y = vec[1],
      z = vec[2]
  
    x = x - viewX
    y = viewHeight - y - 1
    y = y - viewY
  
    out[0] = (2 * x) / viewWidth - 1
    out[1] = (2 * y) / viewHeight - 1
    out[2] = 2 * z - 1
    return transform(out, out, invProjectionView)
  }
docs: Unproject a point from screen space to 3D space.
  The point should have its x and y properties set to
  2D screen space, and the z either at 0 (near plane)
  or 1 (far plane). The provided matrix is assumed to already
  be combined, i.e. projection * view.
  
  After this operation, the out vector's [x, y, z] components will
  represent the unprojected 3D coordinate.
  
  @param  {vec3} out               the output vector
  @param  {vec3} vec               the 2D space vector to unproject
  @param  {vec4} viewport          screen x, y, width and height in pixels
  @param  {mat4} invProjectionView combined projection and view matrix
  @return {vec3}                   the output vector