PEXViewOrientationMatrix2D Utility


Synopsis

 
   int PEXViewOrientationMatrix2D(
       PEXCoord2D *vrp,
       PEXVector2D *vup,
       PEXMatrix3x3 matrix_return
   )
 

Arguments

vrp
View reference point.

vup
View up vector.

matrix_return
Matrix in which result is stored.

Returns

Zero if successful; otherwise, one of the following:

PEXBadVector
vup is zero length.

Description

Invoke PEXViewOrientationMatrix2D to create a view orientation matrix that transforms world coordinates (WC) to view reference coordinates (VRC). This matrix is used in conjunction with a view mapping matrix as the viewing matrices for a designated view.

The view reference point (vrp) defines the point in world coordinate space to be used as the origin of the view reference coordinate system. The point is in the WC z=0 plane.

The view plane normal is in the direction of the positive z axis of WC.

The view up vector (vup) is a 2D vector in the WC z=0 plane. It determines the positive y axis of VRC. It is defined in world coordinates relative to the view reference point.

The x axis of VRC is defined such that the VRC system forms a right-handed coordinate system.

Errors

None.

See Also

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