Share via


Matrix.CreatePerspectiveOffCenter Method (Single, Single, Single, Single, Single, Single)

Builds a customized, perspective projection matrix.

Syntax

'Declaration
Public Shared Function CreatePerspectiveOffCenter ( _
         left As Single, _
         right As Single, _
         bottom As Single, _
         top As Single, _
         nearPlaneDistance As Single, _
         farPlaneDistance As Single _
) As Matrix 
public static Matrix CreatePerspectiveOffCenter (
         float left,
         float right,
         float bottom,
         float top,
         float nearPlaneDistance,
         float farPlaneDistance
)
public:
static Matrix CreatePerspectiveOffCenter(
         float left,
         float right,
         float bottom,
         float top,
         float nearPlaneDistance,
         float farPlaneDistance
)

Parameters

  • left
    Type: Single
    Minimum x-value of the view volume at the near view plane.
  • right
    Type: Single
    Maximum x-value of the view volume at the near view plane.
  • bottom
    Type: Single
    Minimum y-value of the view volume at the near view plane.
  • top
    Type: Single
    Maximum y-value of the view volume at the near view plane.
  • nearPlaneDistance
    Type: Single
    Distance to the near view plane.
  • farPlaneDistance
    Type: Single
    Distance to of the far view plane.

Return Value

Type: Matrix
The created projection matrix.

Remarks

Projection space refers to the space after applying projection transformation from view space. After the projection transformation, visible content has x and y-coordinates ranging from −1 to 1, and a z-coordinate ranging from 0 to 1.

To obtain the viewable area (in world space) of a scene, create a BoundingFrustum and pass the combined view and projection matrix to the constructor.

Exceptions

Exception type Condition
ArgumentOutOfRangeException

One of the following conditions is true:

  • nearPlaneDistance or farPlaneDistance is a negative value. Specify a positive value for nearPlaneDistance or farPlaneDistance.
  • nearPlaneDistance larger than farPlaneDistance. nearPlaneDistance must be smaller than farPlaneDistance.

Requirements

Namespace: Microsoft.Xna.Framework

Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

See Also

Reference

Matrix Structure
Matrix Members
Microsoft.Xna.Framework Namespace

Platforms

Windows Phone