Class StereoUtil


  • public class StereoUtil
    extends Object
    • Constructor Detail

      • StereoUtil

        public StereoUtil()
    • Method Detail

      • getVertPupilCenterFromTop

        public static float getVertPupilCenterFromTop​(float screenHeightInMeters,
                                                      float pupilCenterFromScreenTopInMeters)
        Return the vertical pupil center from the screen top in the range [0..1].
        Parameters:
        screenHeightInMeters -
        pupilCenterFromScreenTopInMeters -
      • getHorizPupilCenterFromLeft

        public static float[] getHorizPupilCenterFromLeft​(float screenWidthInMeters,
                                                          float interpupillaryDistanceInMeters)
        Return the horizontal pupil center from the left side for both eyes in the range [0..1].
                    <-------------left eye------------->|                       |<-----------right eye-------------->
                    <------------------------------------screenSizeInMeters.Width----------------------------------->
                                               <------interpupillaryDistanceInMeters------>
                    <--centerFromLeftInMeters->
                                               ^
                                         center of pupil
         
        Parameters:
        screenWidthInMeters -
        interpupillaryDistanceInMeters -
      • getSBSUpstreamPMV

        public static void getSBSUpstreamPMV​(ViewerPose viewerPose,
                                             StereoDeviceRenderer.Eye eye,
                                             float zNear,
                                             float zFar,
                                             Matrix4f mat4Projection,
                                             Matrix4f mat4Modelview)
        Calculates the Side By Side, SBS, projection- and modelview matrix for one eye.

        #updateViewerPose(int) must be called upfront.

        This method merely exist as an example implementation to compute the matrices, which shall be adopted by the upstream client code.

        Parameters:
        viewerPose -
        eye -
        zNear - frustum near value
        zFar - frustum far value
        mat4Projection - projection matrix result
        mat4Modelview - modelview matrix result