示例#1
0
        public static void GetFieldOfView(Matrix4x4 projectionMatrix, out float fov, out float aspect)
        {
            float focal = projectionMatrix[1, 1];

            fov    = CameraUtility.Focal2Fov(focal);
            aspect = focal / projectionMatrix[0, 0];
        }
示例#2
0
        public static void SetFieldOfView(ref Matrix4x4 projectionMatrix, float fov, float aspect)
        {
            float focal = CameraUtility.Fov2Focal(fov);

            projectionMatrix[0, 0] = focal / aspect;
            projectionMatrix[1, 1] = focal;
        }