Previous Next Up Title Contents Index Functions Index Top Library

1.5.1. 2D VIEW DEFINITION

A PHIGURE 2D view is defined by the TV2CEN function. This makes it possible to project a square in WC space on a zone inside the workstation display surface. This square is defined by its center (center_view) and by a the reciprocal coefficient of half a side. It is possible to make a comparison between,

center and observed point

coefficient and zoom factor

TV2CEN (WKID, VIEWID, xc,yc, zoom, viewport)

the viewport is the display surface area where the square defined in WC space is displayed. It is quite possible to use only rectangular part of the display surface. It is an array of 4 floats expressed between 0 and 1. A viewport = /0,1,0,1/ corresponds to the entire display surface . A viewport = /0,0.5, 0,0.5/ corresponds to the lower left-hand side, etc. A viewport = /0,1,0,1/ is not necessarily square, as the coordinates are in relation to the display surface: if the display surface is rectangular, the viewport = /0,1,0,1/ is also rectangular.

Examples of displays with different view definitions

example 1

example 2

example 3

example 4

example 5

If the viewport is rectangular, the square in WC space is projected by default in the largest centered square inside the viewport.

In the preceding example, although the viewport is identical to the whole display surface, the latter is not completely filled by the contents of the selected square in WC space. PHIGURE view definition functions are programed to maintain the height / width ratio of primitives when they are projected on the display surface.

By default, a circle in space is displayed as a circle on the viewport whatever the dimensions of the viewport.

The ratio maintenance feature may be changed in advance by calling the function :

TVIEWC (WKID, VIEWID, vptype, vpclip)

with vptype = 1, 2 or 3

and vpclip = 0 or 1

to change the "type" of projection on the viewport to the view index VIEWID on workstationWKID.

vptype = 2 corresponds to the the definition of a viewport maintaining the h/w ratio, and is, therefore, the default mode for all PHIGURE view definitions.

vptype = 1 corresponds to the the definition of a viewport where the h/w ratio is not maintained : this mode ensures that the contents of the square selected in WC space are projected on the entire the workstation display surface viewport. Primitives may therefore be distorted :

example with vptype = 1

example with vptype = 2

The value vptype = 0 defines a viewport as understood in PHIGS (see definition of a view in PHIGS).

The vpclip flag indicates whether those parts of the primitives which overlap the square selected in WC space are cut or not when the image is projected on the viewport, when it is not identical to the entire display surface.

Example with vpclip = 1

Example with vpclip = 0


Previous Next Up Title Contents Index Functions Index Top Library