Just that I get it right:
What should I use for VIEWPLANE_Z_VALUE, the far clipping plane?
//...
public SimpleVector reproject2D3DWS(Camera camera, FrameBuffer buffer, int x, int y, SimpleVector toFill) {
SimpleVector ray = Interact2D.reproject2D3D(camera, buffer, x, y, 2000, toFill);
ray.matMul(camera.getBack().invert());
return ray;
}
public void findNearestObject(int touchX, int touchY) {
SimpleVector dir = reproject2D3DWS(camera, frameBuffer, touchX, touchY, new SimpleVector()).normalize();
Object[] res = world.calcMinDistanceAndObject3D(camera.getPosition(), dir, 10000);
//...
}
Is that correct?