PEXPolarViewMatrix(3) — Subroutines
Name
PEXPolarViewMatrix
Synopsis
int PEXPolarViewMatrix(PEXCoord ∗from, double distance, double azimuth, double altitude, double twist, PEXMatrix matrix_return)
Arguments
fromThe viewing position.
distanceThe distance between the ‘from’ position and the position being viewed.
azimuthThe angle in the x,z plane from the +z axis to the line of sight, in radians. Positive values are counter-clockwise when viewed from the positive ‘y’ axis.
altitudeThe angular inclination of the line of sight from the ‘x’,‘z’ plane. The ‘altitude’ argument is the angle in radians. Positive values are towards the positive ‘y’ axis.
twistThe up direction of the view, given as an angle, in radians, about the line of sight. Positive values of twist are in the counter-clockwise direction.
matrix_return
matrix in which result is stored
Returns
Zero if successful; otherwise, one of the following:
PEXBadDistance
Description
This routine formats a polar view orientation matrix. This routine is similar to PEXLookAtViewMatrix, except that the viewing parameters are specified in spherical coordinates. The "from" position defines one end of the view plane normal; the position indicated by "distance", "azimuth", and "altitude" define the base of the view plane normal, and the origin of VRC.
The view is defined with respect to the ‘from’ position (the viewing position) and the distance between it and the position being viewed. The azimuth angle specifies the direction of the line of sight going toward the position being viewed. Positive values of azimuth are counter-clockwise when viewed from the positive y axis.
The azimuth and altitude angles apply to the coordinate system with ‘from’ at the origin and the line of sight emanating from it. The azimuth specifies the angle between the line of sight and the +z axis, and the altitude defines the angle between it and the x,z plane.
When applied, the transformation places the viewing position at the origin, aligns the viewpoint with the +z axis, applies any twist to the coordinates, and then places the viewed point at the origin.
Errors
None
See Also
PEXLookAtViewMatrix, PEXViewOrientationMatrix, PEXViewMappingMatrix