PEXViewMappingMatrix2D Utility


Synopsis

 
   int PEXViewMappingMatrix2D(
       PEXCoord2D *frame,
       PEXCoord2D *viewport,
       PEXMatrix3x3 matrix_return
   )
 

Arguments

frame
Array of two 2D VRC locations which mark a rectangle to be mapped into the NPC subvolume.

viewport
Array of two 2D NPC coordinates specifying lower left and upper right of the viewport.

matrix_return
Matrix in which result is stored.

Returns

Zero if successful; otherwise, one of the following:

PEXBadLimits
The viewing box width or height is zero.

PEXBadViewport
xmin >= xmax, or ymin >= ymax

Description

Invoke PEXViewMappingMatrix2D as a two-dimensional shorthand version of PEXViewMappingMatrix with the following arguments/values assumed:

  front plane distance = 1
  back plane distance = 0
  view plane distance = 0
  viewport z range = [0,1]
  projection type = parallel
  x-y coordinates of projection reference point = center of view window,
     z coordinate = 1.0.
 

When specifying NPC, the x and y limits must be as follows:

xmin < xmax, ymin < ymax

Errors

None.

See Also

For a list of viewing transformation utilities, see Viewing Transformation Utilities. For a list of related topics, see PEXlib Utilities.