.\" @(#)PEXLookAtViewMatrix.3 1.5 95/03/24 SMI; .so man3/pex.macs .TH PEXLookAtViewMatrix 3 "May 1995" "Solaris PEXlib Reference Manual" "" .SH NAME PEXLookAtViewMatrix - utility function .SH SYNTAX .HP int PEXLookAtViewMatrix\^(\^PEXCoord *\fIfrom\fP, PEXCoord *\fIto\fP, PEXVector *\fIup\fP, PEXMatrix \fImatrix_return\fP\^) .SH PARAMETERS .IP \fIfrom\fP 1i Viewing position, in world coordinates. .IP \fIto\fP 1i Look at position, in world coordinates. .IP \fIup\fP 1i Vector representing the \fIup\fP direction, in world coordinates. .IP \fImatrix_return\fP 1i Matrix in which result is stored. .SH RETURNS .LP Zero if successful; otherwise, one of the following: .TP .B PEXBadVectors The .I from and .I to arguments are equal, or the line between them is parallel with the up vector .TP .B PEXBadVector .I Up is zero length. .SH DESCRIPTION .\" indexing .IX PEXLookAtViewMatrix .IX "Utility Functions" PEXLookAtViewMatrix .LP This function creates a view orientation transform that defines the viewing direction and orientation. It is a slightly more intuitive interface to .BR PEXViewOrientationMatrix (3) . .LP The .I from position defines the viewpoint, and the .I to position specifies the point being viewed. These two parameters together define the view reference point (the VRC origin) and the view plane normal of .BR PEXViewOrientationMatrix (3) . The view reference point is the .I to point; the view plane normal is the vector from .I to to .I from. .LP The view up vector is a 3D vector defined in world coordinates relative to the .I to point. The projection of this vector onto the plane through the .I to point and perpendicular to the view plane normal defines the Y axis of VRC. .SH ERRORS None .SH SEE ALSO .LP .nf .BR PEXPolarViewMatrix (3) .BR PEXViewOrientationMatrix (3) .BR PEXViewMappingMatrix (3) .fi