More info

Friday, 7 March 2014

Computer Graphics Notes - Lab 20 - 2D VIEWING AND CLIPPING

INTRODUCTION
We now consider the formal mechanism for displaying views of a picture on an output device. Typically, a graphics package allows a user to specify which part of a defined picture is to be displayed and where that part is to be displayed on the display device. Any convenient Cartesian coordinate system, referred to as the world-coordinate reference frame, can be used to define the picture. For a two-dimensional picture, a view is selected by specifying a sub area of the total picture area. The picture parts within the selected areas are then mapped onto specified areas of the device coordinates. The process of selecting and viewing the picture with different views is called windowing, and a process which divides each element of the picture into its visible and invisible portions, allowing the invisible portion to be discarded is called clipping.

THE VIEWING PIPELINE

A world-coordinate area selected for display is called a window. An area on a display device to which a window is mapped is called a viewport. The window defines what is to be viewed; the viewport defines where is to be displayed. In general, the mapping of a part of a world-coordinate scene to device coordinates is referred to as a viewing transformation. Sometimes the two-dimensional viewing transformation is simply referred to as the window-to-viewport transformation or the windowing transformation.




In computer graphics terminology, the term window originally referred to an area of a picture that is selected for viewing, as defined at the beginning. We will only use the term window to refer to an area of a world-coordinate scene that has been selected for display.

Some graphics packages that provide window and viewport operations allow only standard rectangles, but a more general approach is to allow the rectangular window to have any orientation. In this case, we carry out the viewing transformation in several steps.




MC
Construct World-Coordinate Scene using Modeling-Coordinate Transformations

Convert World-Coordinates to Viewing Coordinates

Map Viewing Coordinates to Normalized Viewing coordinates using Window- Viewport Specifications
Map Normalized Viewport to Device Coordinates



The two-dimensional viewing-transformation pipeline


Objects are placed into the scene by modeling transformations to a master coordinate system, commonly referred to as the world coordinate system (WC). A rectangular window with its edges parallel to the axes of the WC is used to select the portion of the scene for which an image is to be generated. This is referred as viewing coordinate system (VC). The viewing coordinate reference frame is used to provide a method for setting up arbitrary orientations for rectangular windows. Once the viewing reference frame is established, we can transform descriptions in world coordinates to viewing coordinates. We can define a viewport in normalized coordinates (in the range from 0 to 1) and map the viewing coordinate description of the scene to normalized coordinates. At the final step, all parts of the picture that lie outside the viewport are transferred to device coordinates.

By changing the position of viewport, we can view objects at different positions on the display area of an output device. Also, by varying the size of view ports, we can change the size and proportions of displayed objects.



No comments:

Post a Comment