예제 #1
0
 public ViewingFrustum(FrustumKind kind, float left, float right, float bottom, float top, float near, float far)
 {
     if (left >= right || bottom >= top /*|| far >= near */)
         throw new ArgumentException ("Invalid frustum dimensions; " +
             "left >= right or bottom >= top or far >= near.");
     Kind = kind;
     Left = left;
     Right = right;
     Bottom = bottom;
     Top = top;
     Near = near;
     Far = far;
 }
예제 #2
0
 public ViewingFrustum(FrustumKind kind, float left, float right, float bottom, float top, float near, float far)
 {
     if (left >= right || bottom >= top /*|| far >= near */)
     {
         throw new ArgumentException("Invalid frustum dimensions; " +
                                     "left >= right or bottom >= top or far >= near.");
     }
     Kind   = kind;
     Left   = left;
     Right  = right;
     Bottom = bottom;
     Top    = top;
     Near   = near;
     Far    = far;
 }
예제 #3
0
 public ViewingFrustum(FrustumKind kind, float width, float height, float near, float far)
 {
     if (far >= near)
         throw new ArgumentException ("Invalid frustum dimensions; far >= near.");
     Kind = kind;
     Near = near;
     Far = far;
     if (kind == FrustumKind.Perspective)
     {
         var max = Math.Max (width, height);
         Right = width / max;
         Top = height / max;
     }
     else
     {
         Right = width * 0.5f;
         Top = height * 0.5f;
     }
     Left = -Right;
     Bottom = -Top;
 }
예제 #4
0
 public ViewingFrustum(FrustumKind kind, float width, float height, float near, float far)
 {
     if (far >= near)
     {
         throw new ArgumentException("Invalid frustum dimensions; far >= near.");
     }
     Kind = kind;
     Near = near;
     Far  = far;
     if (kind == FrustumKind.Perspective)
     {
         var max = Math.Max(width, height);
         Right = width / max;
         Top   = height / max;
     }
     else
     {
         Right = width * 0.5f;
         Top   = height * 0.5f;
     }
     Left   = -Right;
     Bottom = -Top;
 }