0% found this document useful (0 votes)
297 views

2D Viewing Presentation

The document discusses 2D viewing pipelines and window to viewport coordinate transformations. It describes how object coordinates are transformed through a series of steps to world coordinates, then viewing coordinates, normalized coordinates, and finally to device coordinates. It also explains how a window in one coordinate system (such as viewing coordinates) can be mapped and transformed to a viewport area in another system (like screen/device coordinates) using scaling and translation transformations. Matrix representations are provided for the overall window to viewport transformation.

Uploaded by

Musariri Talent
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)
297 views

2D Viewing Presentation

The document discusses 2D viewing pipelines and window to viewport coordinate transformations. It describes how object coordinates are transformed through a series of steps to world coordinates, then viewing coordinates, normalized coordinates, and finally to device coordinates. It also explains how a window in one coordinate system (such as viewing coordinates) can be mapped and transformed to a viewport area in another system (like screen/device coordinates) using scaling and translation transformations. Matrix representations are provided for the overall window to viewport transformation.

Uploaded by

Musariri Talent
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
You are on page 1/ 10

 2D VIEWING

 THE VIEWING PIPELINES


 VIEWING CORDINATE REFERENCE FRAME
 WINDOW TO VIEW PORT CORDINATE TRANSFORAMTION

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

Window-Viewport Transformation A window-viewport transformation describes the


mapping of a (rectangular) window in one coordinate system into another (rectangular)
window in another coordinate system. This transformation is defined by the section of the
original image that is transformed (clipping window), the location of the resulting window
(viewport), and how the window is translated, scaled or rotated. The following derivation
shows how easy this transformation generally is (i.e. without rotation):

The transformation is linear in x and y, and (xwmin/ywmin)  (xvmin/yvmin),


(xwmax/ywmax)  (xvmax/yvmax) .

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

Processing y analogically, we get an ordinary linear transformation: xv = sxxw + tx, yv =


syyw + ty,

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.

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).
VIEWING COORDINATE REFERENCE FRAME

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

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)

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.


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.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy