Exemplo n.º 1
0
        public void UpdateProjection()
        {
            var aspect = Viewport.AspectRatio;
            var fovV   = FOVUtil.CalcFovx(ini.ThirdPersonCamera.FovX, aspect);

            Projection = Matrix4x4.CreatePerspectiveFieldOfView(fovV, aspect, 3f, 10000000f);
        }
Exemplo n.º 2
0
        public void UpdateProjection()
        {
            const float defaultFOV = 50;

            Projection = Matrix4.CreatePerspectiveFieldOfView(FOVUtil.CalcFovx(defaultFOV, Viewport.AspectRatio), Viewport.AspectRatio, 3f, 10000000f);
            _vpdirty   = true;
        }
Exemplo n.º 3
0
        void CalcCameraProps(out float fovV, out float aspectRatio)
        {
            float screen_ratio = (float)viewport.Width / (float)viewport.Height;
            int   hvaspect     = (int)(Transform.AspectRatio * 100);
            float ratio        = Transform.AspectRatio;
            float fovh         = Transform.FovH;

            if (hvaspect == 133)
            {
                ratio = screen_ratio;
                fovh  = MathHelper.RadiansToDegrees(FOVUtil.CalcFovx(fovh, screen_ratio));
            }
            else if (hvaspect == 185)
            {
                ratio = (screen_ratio * 1.39f); //cinematic ratio (1.85 / 1.33)
                fovh  = MathHelper.RadiansToDegrees(FOVUtil.CalcFovx(fovh, screen_ratio));
            }
            fovV        = FOVUtil.FovVRad(fovh, ratio);
            aspectRatio = ratio;
        }