2D Viewing Presentation
2D Viewing Presentation
The method of selecting and enlarging a portion of a drawing is called windowing. The area
chosen for this display is called a window. The window is selected by world-coordinate.
Sometimes we are interested in some portion of the object and not in full object. So we will
decide on an imaginary box. This box will enclose desired or interested area of the object.
Such an imaginary box is called a window.
Basically, the window is an area in object space. It encloses the object. After the user selects
this, space is mapped on the whole area of the viewport. Almost all 2D and 3D graphics
packages provide means of defining viewport size on the screen. It is possible to determine
many viewports on different areas of display and view the same object in a different angle in
each viewport.
The size of the window is (0, 0) coordinate which is a bottom-left corner and toward right
side until window encloses the desired area. Once the window is defined data outside the
window is clipped before representing to screen coordinates. This process reduces the amount
of data displaying signals.
The window size of the Tektronix 4.14 tube in Imperial College contains 4.96 points
horizontally and 3072 points vertically.
First, we construct the scene in world coordinate using the output primitives and attributes.
To obtain a particular orientation, we can set up a 2-D viewing coordinate system in the
window coordinate plane and define a window in viewing coordinates system.
Once the viewing frame is established, are then transform description in world coordinates to
viewing coordinates.
Then, we define viewport in normalized coordinates (range from 0 to 1) and map the viewing
coordinates description of the scene to normalized coordinates.
At the final step, all parts of the picture that (i.e., outside the viewport are dipped, and the
contents are transferred to device coordinates).
By changing the position of the viewport: We can view objects at different locations on the
display area of an output device as shown in fig:
By varying the size of viewports: We can change the size and proportions of displayed
objects. We can achieve zooming effects by successively mapping different-sized windows
on a fixed-size viewport.
As the windows are made smaller, we zoom in on some part of a scene to view details that
are not shown with larger windows.
2D Viewing Pipeline
The term Viewing Pipeline describes a series of transformations, which are passed by
geometry data to end up as image data being displayed on a device. The 2D viewing pipeline
describes this process for 2D data: norm. object- world- viewing- device- device coord.
coord. coord. coord. coord. The coordinates in which individual objects (models) are created
are called model (or object) coordinates. When several objects are assembled into a scene,
they are described by world coordinates. After transformation into the coordinate system of
the camera (viewer) they become viewing coordinates. Their projection onto a common plane
(window) yields device-independent normalized coordinates. Finally, after mapping those
normalized coordinates to a specific device, we get device coordinates.
For a given point (xw/yw) which is transformed to (xv,yv), we get: xw = xwmin + λ(xwmax-
xwmin) where 0<λ xv = xvmin + λ(xvmax -xvmin)
Calculating λ from the first equation and substituting it into the second yields: xv = xvmin +
(xvmax – xvmin)(xw – xwmin)/(xwmax – xwmin) = xw(xvmax – xvmin)/(xwmax – xwmin)
+ tx where tx is constant for all points, as is the factor sx = (xvmax – xvmin)/(xwmax –
xwmin).
Once object description has been transmitted to the viewing reference frame, we choose the
window extends in viewing coordinates and selects the viewport limits in normalized
coordinates.
Object descriptions are then transferred to normalized device coordinates:
We do this thing using a transformation that maintains the same relative placement of an
object in normalized space as they had in viewing coordinates.
Fig shows the window to viewport mapping. A point at position (xw, yw) in window mapped
into position (xv, yv) in the associated viewport.
Any number of output devices can we open in a particular app, and three windows to
viewport transformation can be performed for each open output device.
This coordinate system provides the reference frame for specifying the world coordinate
window.First, a viewing-coordinate origin is selected at some world position: Po=
( x 0, y 0).Then we need to establish the orientation, or rotation, of this reference
frame. One way to do this is to specify a world vector V that defines the viewingy0,
direction. Vector V is called theview up vector.Given V, we can calculate the components
of unit vectorsv = ( v x, v y)a n d u = ( u x, u y)for theviewingyvandxvaxes,
respectively. These unit vectors are used to form the first and second rows of
therotationmatrix R that aligns the viewingxvyvaxes with the worldxwywaxes.We obtain the
matrix for converting world coordinate positions to viewing coordinates as a two- step
composite transformation:First, we translate the viewing origin to the world origin,Then we
rotate to align the two coordinate reference frames.The composite 2D transformation to
convert world coordinates to viewing coordinate iswhere T is the translation matrix that takes
the viewing origin pointPoto the world origin, and R is the rotation matrix that aligns the axes
of the two reference frames
In order to maintain the same relative placement of the point in the viewport as in the
window, we require:
Solving these impressions for the viewport position (xv, yv), we have
xv=xvmin+(xw-xwmin)sx
yv=yvmin+(yw-ywmin)sy ...........equation 2
Equation (1) and Equation (2) can also be derived with a set of transformation that converts
the window or world coordinate area into the viewport or screen coordinate area. This
conversation is performed with the following sequence of transformations:
1. Perform a scaling transformation using a fixed point position (xw min,ywmin) that scales
the window area to the size of the viewport.
2. Translate the scaled window area to the position of the viewport. Relative proportions
of objects are maintained if the scaling factors are the same (sx=sy).
From normalized coordinates, object descriptions are mapped to the various display devices.
Any number of output devices can we open in a particular app, and three windows to
viewport transformation can be performed for each open output device.
This mapping called workstation transformation (It is accomplished by selecting a window
area in normalized space and a viewport area in the coordinates of the display device).
We can display picture at device or display system according to our need and choice.
Note: