0% found this document useful (0 votes)
93 views8 pages

Window vs Viewport in Graphics

Windowing allows selecting and enlarging a portion of a drawing called a window. A viewport is the area on a display device where the window is mapped. The window, defined in world coordinates, encloses the desired area of an object. Viewing transformations map the window to the viewport through scaling and translation, maintaining the window's relative proportions. This allows viewing different parts of an object by changing the window and viewport positions and sizes. Matrix representations describe the three step viewing transformation as a translation, scaling, and second translation between the window and viewport coordinate systems.

Uploaded by

Zahid Abbas
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
93 views8 pages

Window vs Viewport in Graphics

Windowing allows selecting and enlarging a portion of a drawing called a window. A viewport is the area on a display device where the window is mapped. The window, defined in world coordinates, encloses the desired area of an object. Viewing transformations map the window to the viewport through scaling and translation, maintaining the window's relative proportions. This allows viewing different parts of an object by changing the window and viewport positions and sizes. Matrix representations describe the three step viewing transformation as a translation, scaling, and second translation between the window and viewport coordinate systems.

Uploaded by

Zahid Abbas
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Computer Graphics Window:

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.

Viewport: An area on display device to which a window is mapped [where it is to


displayed].

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.

Viewing transformation or window to viewport transformation or windowing


transformation: The mapping of a part of a world-coordinate scene to device
coordinates is referred to as a viewing transformation etc.
Viewing transformation in several steps:

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.

Computer Graphics Window to Viewport Co-


ordinate Transformation
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.

If a coordinate position is at the center of the viewing window:

It will display at the center of the viewport.

Fig shows the window to viewport mapping. A point at position (xw, yw) in window
mapped into position (xv, yv) in the associated viewport.

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

Where scaling factors are

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).

As in fig, workstation transformation to partition a view so that different parts of


normalized space can be displayed on various output devices).
Matrix Representation of the above three steps of
Transformation:
Step1:Translate window to origin 1
          Tx=-Xwmin Ty=-Ywmin

Step2:Scaling of the window to match its size to the viewport


          Sx=(Xymax-Xvmin)/(Xwmax-Xwmin)
          Sy=(Yvmax-Yvmin)/(Ywmax-Ywmin)

AD

Step3:Again translate viewport to its correct position on screen.


          Tx=Xvmin
          Ty=Yvmin

Above three steps can be represented in matrix form:


          VT=T * S * T1

T = Translate window to the origin

S=Scaling of the window to viewport size

T1=Translating viewport on screen.

AD

Viewing Transformation= T * S * T1

Advantage of Viewing Transformation:


We can display picture at device or display system according to our need and choice.

Note:
o World coordinate system is selected suits according to the application program.
o Screen coordinate system is chosen according to the need of design.
o Viewing transformation is selected as a bridge between the world and screen coordinate.

Common questions

Powered by AI

Viewing transformations offer significant benefits in computer graphics design by serving as a bridge between world coordinates and screen coordinates. They allow for the flexible display of pictures on various device or display systems according to specific needs or preferences . This technique enables designers to easily adjust how objects are represented onscreen, facilitating changes in viewpoint, zoom level, and the projection of parts of the scene on different display devices . These capabilities are essential for applications requiring dynamic interaction with graphical data or multi-device display setups.

Normalized coordinates play a crucial role in the window to viewport transformation process by providing a standardized reference frame (typically ranging from 0 to 1), ensuring cross-device compatibility and easing the mapping of world coordinates to screen coordinates. This intermediary step simplifies the conversion of window descriptions to a consistent format that can be adapted easily to different output devices' coordinate systems . It allows different devices to interpret graphical information uniformly and supports scalability, enabling the application to dynamically display content on various hardware configurations without distortion .

Viewing transformations involve several steps. First, the scene is constructed in world coordinates using output primitives and attributes. A 2-D viewing coordinate system in the window coordinate plane is established to obtain a particular orientation, defining a window in these coordinates. Then, the window description is mapped to normalized coordinates and subsequently to device coordinates . The process involves scaling the window area to the size of the viewport and translating it to the viewport's position . This transformation sequence maintains the relative placement of objects from viewing to normalized coordinates .

Scaling factors in the transformation process play a critical role by determining how the window's dimensions are adjusted to fit the viewport's size. The scaling transformation uses fixed point positions to ensure that the window area is resized accurately to fit within the viewport . Specifically, the equations xv = xvmin + (xw - xwmin) * sx and yv = yvmin + (yw - ywmin) * sy indicate how the scaling factors (sx and sy) adjust the size of the window to match the viewport. These factors ensure that the physical size of objects and their proportional relationships in window coordinates are maintained accurately in viewport coordinates .

Transformation matrices are used to perform the sequence of operations needed to map window coordinates to viewport coordinates. The process involves three main steps: 1. Translation of the window to the origin. 2. Scaling the window to match the size of the viewport. 3. Translation of the scaled window to the position of the viewport . These steps are mathematically represented in matrix form as VT = T * S * T1, where T is the translation to the origin, S is the scaling transformation, and T1 is the translation to the viewport position . This structured approach ensures that objects maintain their proportions and relative placements when mapped from the window to the viewport.

Maintaining the relative placement of objects during window to viewport transformations is crucial for preserving the visual consistency and spatial relationships originally defined in the world coordinates. This ensures that objects remain proportionally represented and accurately positioned relative to one another even after transformation. If a coordinate is centered in the viewing window, it should also appear centered in the viewport, thus maintaining the intended layout and perspective as the scene is mapped from window to viewport . Consistency through relative placement is essential for ensuring a coherent user experience and accurate visual representation.

Zooming is achieved by altering the size of the window relative to a fixed-size viewport. As windows become smaller, they enclose smaller portions of the scene, effectively magnifying details within the viewport which remains constant in size . This successive mapping of various-sized windows onto a fixed viewport can create zooming effects by revealing finer details of a scene that are not visible with larger windows. By changing the proportions and positioning of windows relative to a viewport, the display can emphasize different levels of detail and perspectives in the graphical scene .

Challenges in performing window to viewport transformations across multiple display devices include maintaining consistency in object proportions and positions on different screens, each with distinct resolutions and aspect ratios. This requires precise calculations to handle differences in device capabilities and ensure uniform scaling and translation . Each display may require separate transformations to align viewing results. Additionally, ensuring that graphical content adapts smoothly to different display interfaces involves managing varying coordinate systems and potentially recalibrating the workstation transformations to accurately partition views among diverse output setups .

Output primitives and attributes are fundamental components used to construct scenes in world coordinates. Primitives define the basic shapes and structures, such as lines, polygons, and curves, forming the graphical objects within the scene. Attributes specify the visual properties of these primitives, including color, line style, and fill pattern. These elements collectively establish the detailed layout and visual characteristics of the scene, which are crucial for accurately transforming the scene from world coordinates to viewing coordinates as part of the viewing transformation process . This initial setup is essential to map the graphical data correctly onto normalized device coordinates.

Windowing in computer graphics is the process of selecting and enlarging a portion of a drawing by defining a "window"—an imaginary box that encloses the area of interest of an object. It allows users to focus on or manipulate specific parts of an object rather than the entire object . This window is then mapped to a "viewport" on a display device. The viewport is the area on the display device where the window is projected, and it can show the object from different angles by adjusting the viewport's size or position .

You might also like