Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ view_window(3G) — HP-UX 5.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

vdc_extent(3G)

view_camera(3G)

view_matrix(3G)

view_port(3G)

view_volume(3G)

inquire_size(3G)

gopen(3G)

flush_matrices(3G)

VIEW_WINDOW(3G)

NAME

view_window − define a 2d viewing transformation matrix using a window/viewport model

SYNOPSIS

C Syntax:

void view_window(fildes,x1,y1,x2,y2);
int fildes;
float x1,y1,x2,y2;

FORTRAN77 Syntax:

subroutine view_window(fildes,x1,y1,x2,y2);
integer*4 fildes
real x1,y1,x2,y2;

Pascal Syntax:

procedure view_window(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 window specified in world coordinates. 

Discussion

This function is used to define a new viewing transformation matrix with a simple 2-dimensional window/viewport model.  The viewing transformation matrix is the world to device coordinate transformation, and should include all user defined non-linear transformations such as perspective.  Modeling transformations that affect objects but not the view, such as object translations, rotations, uniform scaling, etc., should appear in modeling matrices pushed on the matrix stack. 

If this function is called when the device is not in MODEL_XFORM mode, the matrix stack is flushed because old transformations based on the viewing transformation are no longer valid.  If this function is called when the device is in the MODEL_XFORM mode, the viewing matrix (at the bottom of the matrix stack) is changed without changing any of the matrices in the rest of the stack. 

Then a viewing transformation matrix based on the new window bounds and the current viewport definition.  The entire window (in world coordinates) maps to the entire viewport (in vdcs) in a distorted fashion if the aspect ratios of the two are not the same.  Subsequent calls to view_port recalculate the viewing transformation matrix using the window established by this call until another starbase function establishes a new viewing transformation matrix. 

The coordinate systems used by Starbase can be conceptually defined as follows:

• User points are assumed to be defined in modeling coordinates.  These points are transformed into world coordinates using a matrix called the modeling transformation matrix (if any matrices have been pushed on the stack).  World coordinates are used to perform any rendering calculations needed. 

• Next, the world coordinates are transformed to device coordinates by the viewing transformation matrix, which is usually the concatenation of user-defined viewing transformations and the vdc-to-device transformation matrix.  When a device is opened, the viewing transformation matrix is simply the vdc-to-device coordinate transformation matrix. 

Use matrix stack manipulation functions to place modeling transformation matrices on the matrix stack.  Use view_camera, view_matrix, view_volume, or view_window to set viewing transformations. 

• If a graphics device has been opened in MODEL_XFORM mode, the modeling transformation cannot be combined with the viewing transformation because special rendering calculations such as shading may be needed after the modeling-to-world-coordinate transformation.  Therefore, matrices pushed on the stack are left undisturbed and all transformations from modeling coordinates to device coordinates are processed in two steps:  modeling to world coordinates, followed by world to device coordinates. 

• If a graphics device is not in MODEL_XFORM mode, the modeling and viewing transformations can be combined.  Thus, the current viewing transformation matrix is post-concatenated to modeling matrices placed on the matrix stack, and subsequent output primitives are transformed, using only the top matrix on the matrix stack. 

DEFAULTS

After gopen or a call to flush_matrices, the current viewing transformation matrix is the vdc-to-device units transformation matrix.

SEE ALSO

vdc_extent(3G), view_camera(3G), view_matrix(3G), view_port(3G), view_volume(3G), inquire_size(3G), gopen(3G), flush_matrices(3G),
Starbase Graphics Techniques.

Hewlett-Packard Company  —  May 11, 2021

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026