Two-Dimensional Viewing Functions

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 6

TWO-DIMENSIONAL

VIEWING FUNCTIONS
• We define a viewing reference system in a PHIGS
application program with the following function:
• evaluateViewOrientationMatrix(x0,y0,xV,yV,error,
view Matrix)
• where parameters x0 and y0 are the coordinates
of the viewing origin, and parameters xV and yV
are the world-coordinate positions for the view up
vector.
• if the input parameters are in error, an integer
error code is generated; otherwise, the view
matrix for the world-to-viewing transformation is
calculated.
• To set up the elements of a window-to-viewport
mapping matrix, we invoke the function
• evaluateViewMappingMatrix(xwmin, xwmax,
ywmin, ywmax, xvmin, xvmax, yvmin, yvmax,
error, viewMappingMatrix)
• the window limits in viewing coordinates are
chosen with parameters xwmin, xwmax, ywmin,
and ywmax;
• theviewport limits are set with the normalized
coordinate positions xvmin, xvmax, yvmin, yvmax
• we can construct several window-viewport pairs and use
them for projecting various parts of the scene to different
areas of the unit square.
• we can store combinations of viewing and window-
viewport mappings for various workstations in a viewing
table with
• setViewRepresentation (ws, viewIndex, viewMatrlx,
viewMappingMatrix, xclipmin, xclipmax, yclipmin,
yclipmax, clipxy)
• where parameter ws designates the output device
(workstation), and parameter viewIndex sets an integer
identifier for this particular window-viewport pair.
• The matrices viewMatrix and viewMappingMatrix
can be concatenated and referenced by the
viewIndex
• Additional clipping limits can also be specified
which usually set to coincide with the viewport
boundaries.
• parameter clipxy is assigned either the value
noclip or the value clip. This allows us to turn off
clipping if we want to view the part of the scene
outside the view- port.
• We can also select noclip to speed up processing
when we know that all of the scene is included
within the viewport limits.
• At the find stage, we apply a workstation
transformation by selecting a workstation
window-viewport pair:
• setWorkstationWindow (ws, xwsWindmin,
xwsWindmax, ywsWindrnin, ywsWindmax)
• setworksrationviewport (ws, xwsVPortmin,
xwsVPortmax, ywsVPortmin, ywsVPortmax)
• The function
setViewIndex(viewIndex)
• selects a particular set of options from the
viewing table.

You might also like