private void setupCamerasAndViews() {
        // TODO: Use LobOVR IPD etc
        if (environment != null) {
            // get desired frustum from original camera
            Camera origCam = environment.getCamera();
            float fFar = origCam.getFrustumFar();
            float fNear = origCam.getFrustumNear();

            // restore frustum on distortion scene cam, if needed
            if (environment.isInstanceRendering()) {
                leftCamera = origCam;
            } else {
                leftCamera = origCam.clone();
            }

            OVRFovPort fp = hardware.getFovPort();
            float hFov = fp.LeftTan() + fp.RightTan();
            float vFov = fp.UpTan() + fp.DownTan();
            getLeftCamera().setFrustumPerspective(hFov / FastMath.TWO_PI * 360, vFov / hFov, fNear, fFar);

            prepareCameraSize(getLeftCamera(), 1f);
            if (environment.getVRHardware() != null) {
                getLeftCamera().setProjectionMatrix(environment.getVRHardware().getHMDMatrixProjectionLeftEye(getLeftCamera()));
            }
            //org.lwjgl.opengl.GL11.glEnable(org.lwjgl.opengl.GL30.GL_FRAMEBUFFER_SRGB);

            if (!environment.isInstanceRendering()) {
                leftViewPort = setupViewBuffers(getLeftCamera(), LEFT_VIEW_NAME);
                rightCamera = getLeftCamera().clone();
                if (environment.getVRHardware() != null) {
                    getRightCamera().setProjectionMatrix(environment.getVRHardware().getHMDMatrixProjectionRightEye(getRightCamera()));
                }
                rightViewPort = setupViewBuffers(getRightCamera(), RIGHT_VIEW_NAME);
            } else if (environment.getApplication() != null) {
                throw new UnsupportedOperationException("Not yet implemented!");
            } else {
                throw new IllegalStateException("This VR environment is not attached to any application.");
            }

            // setup gui
            environment.getVRGUIManager().setupGui(getLeftCamera(), getRightCamera(), getLeftViewPort(), getRightViewPort());
        } else {
            throw new IllegalStateException("This VR view manager is not attached to any VR environment.");
        }
    }
Set up the cameras and views for each eye and the mirror display.
jme3-vr/src/main/java/com/jme3/input/vr/oculus/OculusViewManager.java