/// <summary>
        /// Extracts perspective camera parameters from the frustum, doesn't work with orthographic frustums.
        /// </summary>
        /// <returns>Perspective camera parameters from the frustum</returns>
        public MyFrustumCameraParams GetCameraParams()
        {
            var corners     = GetCorners();
            var cameraParam = new MyFrustumCameraParams();

            cameraParam.Position    = Get3PlanesInterPoint(ref pRight, ref pTop, ref pLeft);
            cameraParam.LookAtDir   = pNear.Normal;
            cameraParam.UpDir       = MyVector3.Normalize(MyVector3.Cross(pRight.Normal, pNear.Normal));
            cameraParam.FOV         = (float)((Math.PI / 2.0 - Math.Acos(MyVector3.Dot(pNear.Normal, pTop.Normal))) * 2);
            cameraParam.AspectRatio = (corners[6] - corners[5]).Length() / (corners[4] - corners[5]).Length();
            cameraParam.ZNear       = (cameraParam.Position + (pNear.Normal * pNear.D)).Length();
            cameraParam.ZFar        = (cameraParam.Position + (pFar.Normal * pFar.D)).Length();
            return(cameraParam);
        }
 /// <summary>
 /// Creates a new frustum relaying on perspective camera parameters
 /// </summary>
 /// <param name="cameraParams">The camera params.</param>
 /// <returns>The bounding frustum from camera params</returns>
 public static MyBoundingFrustum FromCamera(MyFrustumCameraParams cameraParams)
 {
     return(FromCamera(cameraParams.Position, cameraParams.LookAtDir, cameraParams.UpDir, cameraParams.FOV, cameraParams.ZNear, cameraParams.ZFar, cameraParams.AspectRatio));
 }