private static float GetMaxCornerOffset(CameraOrbit camera) { camera.UpdateViewMatrix(); var test = camera.Target + camera.Right * camera.Radius * 0.01f; return(Vector3.TransformCoordinate(test, camera.ViewProj).X.Abs()); }
private static float GetMaxCornerOffset(Vector3[] corners, CameraOrbit camera) { camera.UpdateViewMatrix(); var maxOffset = 0f; for (var i = 0; i < corners.Length; i++) { var vec = Vector3.TransformCoordinate(corners[i], camera.ViewProj); var offset = new Vector2(vec.X, vec.Y).Length(); maxOffset += offset; } return(maxOffset / corners.Length); }