public void UpdateProjection() { var aspect = Viewport.AspectRatio; var fovV = FOVUtil.CalcFovx(ini.ThirdPersonCamera.FovX, aspect); Projection = Matrix4x4.CreatePerspectiveFieldOfView(fovV, aspect, 3f, 10000000f); }
public void UpdateProjection() { const float defaultFOV = 50; Projection = Matrix4.CreatePerspectiveFieldOfView(FOVUtil.CalcFovx(defaultFOV, Viewport.AspectRatio), Viewport.AspectRatio, 3f, 10000000f); _vpdirty = true; }
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; }