0% found this document useful (0 votes)
10 views5 pages

CG Notes Unit - Ii

Two-dimensional viewing in computer graphics involves mapping world coordinates to device coordinates through a series of transformations known as the 2D viewing pipeline. The window-viewport transformation allows for the selection of a rectangular region of interest (window) and its mapping to a display area (viewport) on the screen. Clipping transformations, including point, line, polygon, and text clipping, are performed to determine which parts of the graphical data should be displayed, with the Cohen Sutherland line clipping algorithm being one of the methods used for line clipping.

Uploaded by

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

CG Notes Unit - Ii

Two-dimensional viewing in computer graphics involves mapping world coordinates to device coordinates through a series of transformations known as the 2D viewing pipeline. The window-viewport transformation allows for the selection of a rectangular region of interest (window) and its mapping to a display area (viewport) on the screen. Clipping transformations, including point, line, polygon, and text clipping, are performed to determine which parts of the graphical data should be displayed, with the Cohen Sutherland line clipping algorithm being one of the methods used for line clipping.

Uploaded by

Aasha Ganesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

UNIT - II

Two Dimensional Viewing:


Two-dimension viewing in Computer graphics is a technique to map the world coordinates
system (actual coordinates of the object in the real world) to device coordinates (actual
coordinates of the object on the output screen like a monitor).

2D Viewing Pipeline:
This involves a series of transformations performed, right from creation, till the
object is finally seen or displayed at a position or a viewing region on a display device
like monitor. Each transformation step performed converts data from one coordinate
system to the other.

The sequence of steps in the 2D viewing Pipeline are

MC -> WC->VC-> CC->NVC-> DC


where
MC – Modeling Coordinates (Modeling or Local Coordinate system)
WC – World coordinates (World Coordinate system)
VC – viewing coordinates (Viewing coordinate system)
CC – Clipping coordinates (Viewing coordinate system)
NVC – Normalized viewing or device independent coordinates (Viewing coordinate
system, but normalized)
DC – Device coordinates (Device coordinate system specific to every device)
Window-Viewport Transformation:
 In Computer Graphics terminology, a window is a rectangular region of interest, and
a viewport is a display area chosen on the monitor screen for viewing the contents of
the window.
 In short, window is ‘what we want to see’ and viewport is ‘where we want to see’. As
shown in the figure below, we can define a rectangular region in the world coordinate
system, and call that as window. The contents of the window are to be mapped to a
region or a display area chosen as viewport.
 In a way this is, mapping contents between two rectangular regions of different
dimensions. Window is generally defined in the world coordinate system,
while viewport is defined in the end device coordinate system. Since we wish to
convert data to device independent or normalized coordinates,
 we perform window-viewport transformation. So in window-viewport transformation
contents of the window are mapped to normalized coordinates (coordinates between 0
and 1).
Clipping transformation can be performed either in the world coordinate system or in the
viewport coordinate system. Clipping in the World coordinate system involves selecting the
contents inside the clip window region and apply transformations only on them.

In viewport clipping, the whole of the contents from the world are brought to the viewport and
then clipping against the viewport. It is thus more convenient to perform clipping in the world
coordinate system.

The types of clipping that we are going to learn are

 Point clipping
 Line clipping
 Polygon Clipping
 Text Clipping

Point Clipping:

In point clipping, points that are inside the rectangular region are selected for display and points
that are outside the region are discarded. Now the question is, how do we know whether a point
is inside or outside a given rectangular region? For this we should perform a test as shown.
Line Clipping:

It is performed by using the line clipping algorithm. The line clipping algorithms are:

1. Cohen Sutherland Line Clipping Algorithm


2. Midpoint Subdivision Line Clipping Algorithm
3. Liang-Barsky Line Clipping Algorithm

Cohen Sutherland Line Clipping Algorithm:


In the algorithm, first of all, it is detected whether line lies inside the screen or it is outside the
screen. All lines come under any one of the following categories:

1. Visible
2. Not Visible
3. Clipping Case

1. Visible: If a line lies within the window, i.e., both endpoints of the line lies within the
window. A line is visible and will be displayed as it is.

2. Not Visible: If a line lies outside the window it will be invisible and rejected. Such lines will
not display. If any one of the following inequalities is satisfied, then the line is considered
invisible. Let A (x1,y2) and B (x2,y2) are endpoints of line.

3. Clipping Case: If the line is neither visible case nor invisible case. It is considered to be
clipped case. First of all, the category of a line is found based on nine regions given below.
All nine regions are assigned codes. Each code is of 4 bits. If both endpoints of the line
have end bits zero, then the line is considered to be visible.
Advantage of Cohen Sutherland Line Clipping:
1. It calculates end-points very quickly and rejects and accepts lines quickly.
2. It can clip pictures much large than screen size.

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