protected double distanceToEncloseRect(double width, double height) {
        double fovY = getVerticalFOV();
        double fovX = fovY * getFrame().width() / getFrame().height();

        double xDist = width / (2 * Math.tan(fovX / 2));
        double yDist = height / (2 * Math.tan(fovY / 2));

        return Math.max(xDist, yDist);
    }
Renders a viewport within the node frame. Overrides provided to obtain the camera position fov, etc.
core/src/main/java/mrtjp/projectred/redui/ViewportRenderNode.java