PEXViewOrientationMatrix(3) — Subroutines
Name
PEXViewOrientationMatrix
Synopsis
int PEXViewOrientationMatrix(PEXCoord ∗vrp, PEXVector ∗vpn, PEXVector ∗vup, PEXMatrix matrix_return)
Arguments
vrpview reference point
vpnview plane normal
vupview up vector
matrix_return
matrix into which result is stored
Returns
Zero if successful; otherwise, one of the following:
PEXBadVector - either vpn or vup is zero length
PEXBadVectors - vup is parallel to vpn
Description
This function creates 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 that is to be used as the origin of the view reference coordinate system.
The view plane normal (VPN) is a 3D vector defined in world coordinates relative to the view reference point. This gives the direction of the positive Z axis of VRC.
The view up vector (VUP) is a 3D vector defined in world coordinates relative to the view reference point. The projection of this vector onto the plane through the view reference point and perpendicular to the view plane normal defines the Y axis of VRC.
The X axis of VRC is defined such that the VRC system forms a right-handed coordinate system.
Errors
None
See Also
PEXViewOrientationMatrix2D, PEXViewMappingMatrix, PEXViewMappingMatrix2D