VIEW_PORT(3G)
NAME
view_port − define mapping area on view_surface for subsequent view_windows, view_volumes, and view_cameras
SYNOPSIS
C Syntax:
void view_port(fildes,x1,y1,x2,y2);
int fildes;
float x1,y1,x2,y2;
FORTRAN77 Syntax:
subroutine view_port(fildes,x1,y1,x2,y2);
integer*4 fildes
real x1,y1,x2,y2;
Pascal Syntax:
procedure view_port(fildes:integer; real x1,y1,x2,y2);
DESCRIPTION
Input Parameters
fildes Integer file descriptor returned by gopen when an I/O path to a graphics device is opened.
x1,y1,x2,y2 Boundaries of the new viewport specified in virtual device coordinates (vdcs).
Discussion
This function defines a new viewport on the virtual device that view_window, view_volume, and view_camera functions map to. It also sets the range of vdc space that is to be zbuffered when hidden surface removal is active.
When using view_window or view_volume, the entire window/volume (in world coordinates) maps to the entire viewport (in vdcs). This causes distortion if the aspect ratios of the two are not the same or if mapping mode is set to DISTORT. When using view_camera, the camera view will appear within the bounds of the viewport with no distortion.
After changing the viewport range, this function tries to re-calculate the viewing transformation matrix if the last viewing transformation matrix was set with view_window, view_volume, or view_camera. If the last viewing transformation matrix was set with view_matrix, or if the viewing transformation matrix is the vdc-to-device matrix, view_port does not try to recalculate the viewing transformation matrix. The viewing transformation matrix is the vdc-to-device matrix if no viewing function (view_window, view_volume, view_camera, or view_matrix) has been called since gopen time or since the last call to flush_matrices.
This viewport is truncated to the current vdc_extent if it exceeds the range of vdc.
DEFAULTS
After gopen, the default viewport is the same as the default vdc_extent.
SEE ALSO
view_camera(3G), view_window(3G), view_volume(3G), view_matrix(3G), vdc_extent(3G), hidden_surface(3G), zbuffer_switch(3G), inquire_size(3G), gopen(3G),
Starbase Graphics Techniques.
Hewlett-Packard Company — May 11, 2021