/// <summary>
        /// A copy constructor.
        /// </summary>
        /// <param name="source"></param>
        public StereoCamera(StereoCamera source)
        {
            translation = source.Translation;
            rotation    = source.Rotation;
            projection  = source.Projection;
            fieldOfView = source.FieldOfViewY;
            aspectRatio = source.AspectRatio;
            zNearPlane  = source.ZNearPlane;
            zFarPlane   = source.ZFarPlane;

            interpupillaryDistance = source.InterpupillaryDistance;
            focalLength            = source.FocalLength;

            leftViewMatrix        = source.LeftView;
            rightViewMatrix       = source.RightView;
            leftProjectionMatrix  = source.LeftProjection;
            rightProjectionMatrix = source.RightProjection;

            modifyLeftView        = false;
            modifyRightView       = false;
            modifyLeftProjection  = false;
            modifyRightProjection = false;
        }
Exemple #2
0
        private void SetupStereoCamera()
        {
            StereoCamera camera = new StereoCamera();
            camera.Translation = new Vector3(0, 0, 0);
            camera.FieldOfViewY = (float)Math.PI / 4;
            // For stereo camera, you need to setup the interpupillary distance which is the distance
            // between the left and right eyes
            camera.InterpupillaryDistance = 19.31f;
            CameraNode cameraNode = new CameraNode(camera);

            scene.RootNode.AddChild(cameraNode);
            scene.CameraNode = cameraNode;

            // The stereo mode only works correctly when it's in full screen mode when iWear VR920
            // is used
            if (iTracker.ProductID == iWearDllBridge.IWRProductID.IWR_PROD_VR920)
            {
                graphics.IsFullScreen = true;
                graphics.ApplyChanges();
            }
        }
Exemple #3
0
        private void SetupStereoCamera()
        {
            StereoCamera camera = new StereoCamera();

            // Load the right eye view matrix from a calibration file created in StereoCameraCalibration tool
            Matrix cameraRightView = Matrix.Identity;
            MatrixHelper.LoadMatrixFromXML("Wrap920_1_Stereo_Millimeter.xml", ref cameraRightView);

            camera.LeftView = Matrix.CreateLookAt(Vector3.Zero, -Vector3.UnitZ, Vector3.UnitY);
            camera.RightView = Matrix.Invert(cameraRightView);

            CameraNode cameraNode = new CameraNode(camera);

            scene.RootNode.AddChild(cameraNode);
            scene.CameraNode = cameraNode;
        }
Exemple #4
0
        private void SetupStereoCamera()
        {
            StereoCamera camera = new StereoCamera();
            camera.Translation = new Vector3(0, 0, 0);

            CameraNode cameraNode = new CameraNode(camera);

            scene.RootNode.AddChild(cameraNode);
            scene.CameraNode = cameraNode;
        }
        private void SetupStereoCamera()
        {
            // Create a stereo camera
            StereoCamera camera = new StereoCamera();
            camera.Translation = new Vector3(0, 0, 0);

            // Set the interpupillary distance which defines the distance between the left
            // and right eyes
#if VR
            camera.InterpupillaryDistance = 5.5f; // 5.5 cm
#else
            camera.InterpupillaryDistance = 20; 
#endif
            // Set the focal distance to be at infinity
            camera.FocalLength = float.MaxValue;

            CameraNode cameraNode = new CameraNode(camera);

            scene.RootNode.AddChild(cameraNode);
            scene.CameraNode = cameraNode;
        }
Exemple #6
0
        /// <summary>
        /// A copy constructor.
        /// </summary>
        /// <param name="source"></param>
        public StereoCamera(StereoCamera source)
        {
            translation = source.Translation;
            rotation = source.Rotation;
            projection = source.Projection;
            fieldOfView = source.FieldOfViewY;
            aspectRatio = source.AspectRatio;
            zNearPlane = source.ZNearPlane;
            zFarPlane = source.ZFarPlane;

            interpupillaryDistance = source.InterpupillaryDistance;
            focalLength = source.FocalLength;

            leftViewMatrix = source.LeftView;
            rightViewMatrix = source.RightView;
            leftProjectionMatrix = source.LeftProjection;
            rightProjectionMatrix = source.RightProjection;

            modifyLeftView = false;
            modifyRightView = false;
            modifyLeftProjection = false;
            modifyRightProjection = false;
        }