written 6.8 years ago by |
The World Coordinate System (WCS) is infinite in extent and the device display area is finite. Therefore, to perform a viewing transformation we select a finite world coordinate area for display called a Window. An area on a device to which a window is mapped is called a Viewport. The window defines what is to be viewed; the viewport defines where it is to be displayed, as shown in the figure (b).
Window to Viewport Co-ordinate Transformation:-
Once the window co-ordinates are transferred to viewing co-ordinates we choose the window extents in viewing co-ordinates and select the viewport limits in normalized co-ordinates. Object descriptions are then transferred to normalize device co-ordinates. In this transformation, the relative placement of the object in the normalized co-ordinates is same as in the viewing co-ordinates.
The figure (d) shows the mapping of object from window to viewport. A point at Position (Xw, Yw) in the window is mapped into Position (Xv, Yv) in the associated viewport. To maintain the same relative placement in the viewport as in the window we require that
The mapping of window to viewport also can be achieved by performing following transformations:
By performing scaling transformation using a fixed-point position of (Xwmin, Ywmin) that scales the window area to the size of the viewport area.
By translating the scaled window area to the position of the viewport area.
While performing these transformations scaling factors Sx and Sy are kept same to maintain the relative proportions of objects. The character strings are transformed in two ways; they are either transformed without any change or if they are formed with line segments, they are transformed as a sequence of Line transformations.