public Vector3 ndcToWorldCoordinates(double ndcX, double ndcY, double planeDist) {
        // Assume camera at 0,0,0 facing -z
        // Find top and right sides of target plane visible in this viewport
        double maxY = Math.tan(fovY / 2) * planeDist;
        double maxX = maxY * width / height;

        // Map ndc points onto plane to get look vector
        double dx = ndcX * maxX;
        double dy = ndcY * maxY;
        Vector3 lookVec = new Vector3(dx, dy, -planeDist);

        // Apply transforms to account for camera position and orientation
        orientationMatrix.apply(lookVec);
        lookVec.add(cameraPosition);

        return lookVec;
    }
Projects NDC coordinates [-1, 1] onto a target plane at some fixed distance
to the camera taking into account the FOV. This target plane is assumed to be
parallel to the near and far planes of the perspective view frustum.

@param ndcX X coordinate on the viewport in [-1, 1] range
@param ndcY Y coordinate on the viewport in [-1, 1] range
@param planeDist Distance of the projection
@return Projection of (ndcX, ndcY) into world-space
core/src/main/java/mrtjp/projectred/redui/PVMMatrix.java