0% found this document useful (0 votes)
14 views109 pages

Unit 4

The document discusses two-dimensional viewing functions in OpenGL, focusing on 2D viewing techniques, projection modes, and window-to-viewport transformations. It covers the use of OpenGL functions for setting up display windows, managing viewports, and implementing line and polygon clipping algorithms. Key algorithms such as Liang-Barsky for line clipping and methods for polygon clipping are also explained, emphasizing the importance of clipping in rendering visible portions of graphics.

Uploaded by

Komal Garg
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)
14 views109 pages

Unit 4

The document discusses two-dimensional viewing functions in OpenGL, focusing on 2D viewing techniques, projection modes, and window-to-viewport transformations. It covers the use of OpenGL functions for setting up display windows, managing viewports, and implementing line and polygon clipping algorithms. Key algorithms such as Liang-Barsky for line clipping and methods for polygon clipping are also explained, emphasizing the importance of clipping in rendering visible portions of graphics.

Uploaded by

Komal Garg
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/ 109

TWO-DIMENSIONAL VIEWING

FUNCTIONS
Submitted By:-
2K20/CO/415 Satyam Yadav
2K20/CO/423 Shaurya Garg
OpenGL 2D Viewing:
• OpenGL designed for 3D.
• Some 3D viewing routines can be adapted.
• Core library does support a viewport function
• GLU provides 2D clipping function
• GLUT allows one to manipulate display windows
OpenGL Projection Mode
• OpenGL does not support a separate viewing coordinate system
• Set clipping window as part of projection transformation.
• To specify projection transformation, first get into the correct
matrix mode:
glMatrixMode(GL_PROJECTION);
For good measure can also set identity matrix:
glLoadIdentity()
GLU Clipping Window
• To specify the clipping window do:
gluOrtho2D(xwmin, xwmax, ywmin, ywmax);
• Coordinates are doubles.
• For 3D the effect of the above is to project out the z-axis.
• Has no effect on 2D scenes except to map to normalized
coordinates.
• For OpenGL these have range between -1,1.
OpenGL Viewport Function
• To specify the viewport use:
glViewport(xvmin, yvmin, vpWidth, vpHeight);
• xvmin, yvmin specify the position of the lower left corner of the
viewport relative to the bottom of the display window.
• vpWidth, vpHeight give width and height.
• To get the info about the currently active viewport can use:
glGetIntegerv(GL_VIEWPORT, vpArray);
• vpArray is a four element array
GLUT Display Windows
• GLUT is used to manipulate display windows for the programs we
have been writing.
• To start up GLUT:
glutInit(&argc, argv);
• Then to set up the display window:
glutInitWindowPosition(xTopLeft, yTopLeft);
glutInitWindowSize(dwWidth, dwHeight);
glutCreateWindow(“Title”);
• The windowing system can choose to ignore info passed by GLUT
• At this point window is not yet displayed
Display Mode and Color
• Next we set the display window parameters with:
glutInitDisplayMode(mode);
• To set the background color:
glClearColor(red, green, blue, alpha);
or in index mode:
glClearIndex(index);
Window IDs
• When create a window can obtain its ID:
windowID = glutCreateWindow(“my window”);
• IDs start at 1.
• Can use ID to get rid of a display window:
glutDestroyWindow(windowID);
• Can use ID to set active display glutSetWindow(windowID);
• To get active window:
currentWindowID = glutGetWindow();
Repositioning and Resizing the Window
• To move the active window to a new position:
glutPositionWindow(x, y);
• To change its size:
glutReshapeWindow(width, height);
• To make the window fullscreen:
glutFullScreen();
• To set a callback which will be called whenever the position or
size of display is changed:
glutReshapeFunc(myfunc);
Managing Multiple Displays
• Glut has many function for manipulating the window. For example:
glutIconifyWindow(); //shrink window to an icon
glutSetWindowTitle(“new title”); // make window front window
glutSetWindow(windowID);
glutPopWindow(); //make window back window
glutSetWindow(windowID);
glutPushWindow();
glutHideWindow(); //take window offscreen
glutShowWindow(); // put onscreen / de-iconify
Thank you
The viewing pipeline and
viewing coordinate reference
frame

◈ Submitted by:
◈ MANAN KHURANA(2K19/CO/211)
◈ NITISH KASHNIA(2K20/CO/310)
◈ Submitted to: Rashmi Yadav
Window
• Area selected in world-coordinate for display is called
window.
Viewport
• Area on a display device in which window image is
display (mapped) is called viewport.
Viewing Transformation
• The mapping of a part of a world-coordinate scene to
device coordinates is referred to as a viewing
transformation.
Viewing pipeline

• The general processing steps for converting modeling


coordinates to device coordinates is Viewing Pipeline
Viewing pipeline
(1)
• Construct the shape of individual objects in a scene
within modeling coordinate, and place the objects into
appropriate positions within the scene (world
coordinate) using modeling coordinate
transformation.
Viewing pipeline (2)

• We convert viewing coordinates from world


coordinates using window to viewport transformation.
Viewing pipeline (3)
• We map viewing coordinate to normalized viewing
coordinate in which we obtain values in between 0
to 1.
Viewing pipeline (4)
• At last we convert normalized viewing coordinate to
device coordinate using device driver software which
provide device specification.
2D Viewing pipeline
1
World: Clipping window Screen: Viewport

ywma yvma
x x

ywmi yvmi
n n
xwmi xwma xvmi xvma

Clipping window: Viewport:


What do we want to see? Where do we want to see it?
2D Viewing
pipeline 2
World:Clipping window Screen: Viewport

ywma yvma

ywmi yvmi

xwmi xwma xvmi xvma

Clipping window:
Panning…
2D Viewing
pipeline 2
World: Clipping window Screen: Viewport

ywma yvma
x

ywmi yvmi
n
xwmi xwma xvmi xvma

Clipping window:
Panning…
2D Viewing
pipeline 3
World: Clipping window Screen: Viewport

ywma yvma

ywmi yvmi

xwmi xwma xvmi xvma

Clipping window:
Zooming…
2D Viewing
pipeline 3
World: Clipping window Screen: Viewport
ywma
yvma

yvmi
ywmi
xwmi xwma xvmi xvma

Clipping window:
Zooming…
Viewing-Coordinate Reference
Frame
• This coordinate system provides the reference frame for
specifying the world- coordinate window. We set up the viewing
coordinate system using transformations between coordinate
system.

Translation Rotation
WINDOW-TO-VIEWPORT
TRANSFORMATION
SATWIK SHRIDHAR (2K20/CO/412)

KUNAL SARWAN (2K20/CO/410)


TOC

WINDOWPORT
VIEWPORT
WINDOW TO VIEWPORT MAPPING
TRANSFORMATION &
TRANSLATION
SCALING & SHEARING
INTRODUCTION
❖ Window-to-Viewport mapping is the process of mapping or
transforming a two-dimensional, world-coordinate scene to
device coordinates, In particular, objects inside the world or
clipping window are mapped to the viewport. The viewport
is rectangular area on screen where world coordinates are
mapped to be displayed.
❖ In other words, the clipping window is used to select the
part of the scene that is to be displayed. The viewport is
used to display selected portion of window on the output
device.
WINDOW TO
VIEWPORT
TRANSFORMATION
● WINDOW PORT: A world coordinate area selected
for display.

● VIEW PORT: This is s rectangular region of the


screen which is selected for displaying the object. In
other words we can say that view port is part of
computer screen.

● WINDOW TO VIEWPORT MAPPING: Mapping of


a part of a world coordinate scene to device
coordinate is referred to as a viewing transformation.

● WINDOW-TO-VIEWPORT TRANSFORMATION is
the process of transforming 2D world-coordinate
objects to device coordinates.
WINDOW TO VIEWPORT MAPPING
CONCEPT OF TRANSFORMATION

● It may be possible that size of viewport is smaller than size of window or


greater than size of window.
● In this case we have to expand or decrease the size of window according to
the size of viewport.
● In this concept same mapping is required to convert size of window into
size of viewport.
● Some mathematical computations are required to map window and
viewport.
Steps For Window to viewport transformation

● Step 1 Translate window towards origin To shift window


towards origin, lower left or upper left or upper left
corner of window will become (-). Hence translation
factor will become negative. (-tx,-ty).

(-wxL, -wyL) - when origin is lower left corner of the


screen.

(-wxL, -wyH) - When origin is upper left corner of


window.
Steps For Window to viewport transformation

● Step 2 Resize window to the size of view port.

To convert window size in to view port size


following computation is required.
Steps For Window to viewport transformation

● Step 3 ➢ Translate window (position of window must be


same as position of viewport).
➢ If lower left corner of viewport is (0,0) we don’t
need to take step 3 because window lower left
corner is already shifted on origin after taking
first step.
➢ If lower left corner is not (0,0) we have to take
translation factor (+).
Steps For Window to viewport transformation
Steps For Window to viewport transformation
EXAMPLE
● Let us consider an example of viewport transformation.

● If our windows has coordinates (10,10) , (20,10), (20,20), (10,20).

● Let our viewport coordinates are (.5, .5) , ( 1, .5) , (1 , 1 )(.5 , 1)

➢ Take step 1 : Translate window to origin


○ In this case translation matrix will become:
EXAMPLE

➢ Take step 2 : Convert size of windows to viewport size


○ Sx = ( 1 - 0.5 ) / ( 11- 1 ) → 0.5 / 10 → 0.05

○ Sy = ( 1 - 0.5 ) / ( 11- 1 ) → 0.5 / 10 → 0.05

➢ So scaling transformation matrix will be


Step 3 : Window to position of viewport
Composition of
transformations
THANK YOU
Barsky line
clipping algorithm
presented by:-

Shorya Agarwal Shruti


2K20/CO/437 2K20/CO/439
LINE CLIPPING
CONTENTS OF
PRESENTATION LIANG- BARSKY
ALGORITHM

EXAMPLE

ADVANTAGES

APPLICATIONS
Line Clipping
Line clipping is technique in
computer graphics used to display a
given set of lines in our desired
window, computer screen on
rectangular area of interest.
It helps to remove those lines lying
outside the windows.
Liang-Barsky algorithm
The Liang-Barsky algorithm is a line clipping algorithm. This algorithm is more
efficient than Cohen–Sutherland line clipping algorithm and can be extended to
3-Dimensional clipping.

The following concepts are used in this clipping:

1. The parametric equation of the line.


2. The inequalities describing the range of the clipping window which is used to
determine the intersections between the line and the clip window.
Parametric equations:
X = X1 + T(X2-X1)
Y = Y1 + T(Y2-Y1)
where T is between 0 and 1
then writing the point clipping in parametric form
xwmin <= x1 + t(x2-x1) <= xwmax
ywmin <= y1 + t(y2-y1) <= ywmax

the above equations can be expressed as tpk <= qk, where p and q are defined as:

p1 = -(x2-x1), q1 = x1 - xwmin (Left Boundary)


p2 = (x2-x1), q2 = xwmax - x1 (Right Boundary)
p3 = -(y2-y1), q3 = y1 - ywmin (Bottom Boundary)
p4 = (y2-y1), q4 = ywmax - y1 (Top Boundary)
Algorithm:

01 02 03 04
Write a specific Obtain pk and qk check which case find if the line
Set line for k =1: 4 is true for the can be rejected or
intersection and forming the corresponding intersection
parameters t- table. values of pk and parameters (t1 and
entry (t1) = 0.0 qk t2) must be
and t-leaving (t2) adjusted.
= 1.0
Step 1
Set line intersection parameters tentry (t1) = 0.0 and tleaving (t2) = 1.0

Step 2
Obtain pk and qk for k =1: 4
Step 3
If pk = 0, the line is parallel to the corresponding clipping boundary.

a) If pk = 0 and qk<0, the line is completely outside the boundary.


b) If pk = 0 and qk>=0, the line is inside the parallel clipping
boundary.
Step 4

Using pk and qk (k =1 :4), find if the line can be rejected or intersection


parameters (t1 and t2) must be adjusted.

• if pk < 0, update t1 as max[0, qk/pk] where k =1:4


• if pk > 0, update t2 as min[1, qk/pk] where k =1:4

After the update,


• If t1 > t2, reject the line
• If t1 > 0, calculate new values of x1, y1
• If t2 < 1, calculate new values of x2, y2
EXAMPLE
GIVEN :

Where,
P0 = Initial Point of line
P1 = Ending Point of line
dx = horizontal distance between P0 and P 1
dy = vertical distance between P0 and P 1
Now check for :
p1 (LEFT EDGE )
Now check for :
p2 (RIGHT EDGE )
Now check for :
p3 (BOTTOM EDGE )
Now check for :
p4 (TOP EDGE )
CLIPPED
LINE
New P0 ( x0 + t1* dx , y0 + t1*dy )
= ( 30 + t1*250 , 20 + t1*140 )
= ( 101.425 , 59.998 )
New P1 ( x0 + t2*dx , y0 + t2*dy )
= ( 230 , 132 )
ADVANTAGES
More efficient.
Only requires one division to
update 𝑡1 and 𝑡2.
Window intersections of line
are calculated just once.
APPLICATIONS
Drawing and painting operations that allow parts of a
picture to be selected for copying, moving, erasing, or
duplicating.
Extracting part of a defined scene for viewing
Identifying visible surfaces in three-dimensional views
Antialiasing line segments or object boundaries
Creating objects using solid-modeling procedures
Displaying a multi window environment;
Thank you !
ALGORITHM FOR
POLYGON
CLIPPING
Sorabh Guliya (2K20/CO/444)

Srishti Arora (2K20/CO/446)


CLIPPING

When we have to display a large portion of the picture, then not only scaling &
translation is necessary, the visible part of picture is also identified. This process is
not easy as certain parts of the image are inside, while others are partially inside.
The lines or elements which are partially visible are omitted.

For deciding the visible and invisible portion, a particular process called clipping is
used. Clipping determines each element into the visible and invisible portion.
Visible portion is selected and the invisible portion is discarded.
TYPES OF CLIPPING

Point Clipping
Line Clipping
Polygon Clipping (Area Clipping)
Curve Clipping
Text Clipping
Exterior Clipping
POLYGON CLIPPING

To clip a polygon, we can’t directly apply a line


clipping method to the individual polygon edges
because the approach would produce a series of
unconnected line segments as shown in figure.

For Polygon clipping, we require an algorithm that


will generate one or more closed areas that are then
scan converted for the area fill.

The o/p of a polygon clipper should be a sequence of


vertices that defines the clipped polygon boundaries.
Sutherland-Hodgeman Polygon Clipping

It is performed by processing the boundary of polygon against each window corner or


edge. First of all entire polygon is clipped against one edge, then resulting polygon is
considered, then the polygon is considered against the second edge, so on for all four
edges.
Possible Situations while Processing the Algorithm

If the first vertex is outside the window & the second vertex
is inside the window. Then second vertex is added to the
output list. The point of intersection of window boundary and
polygon side (edge) is also added to the output line.

If both vertices are inside window boundary.


Then only second vertex is added to the
output list.
If the first vertex is inside the window and
second is outside the window. The edge which
intersects with window is added to output list.

If both vertices are outside the


window, then nothing is added to
output list.
WEILER-ATHERTON ALGORITHM

It was developed to clip a fill area that is either a convex polygon or a concave polygon. The basic idea
of this algorithm is that instead of proceeding around the polygon edges, we will follow the window
boundaries.

One of the drawbacks of Sutherland hodgeman algo was that it could clip the convex polygon correctly,
but there was an inclusion of extraneous lines while clipping concave polygon.

This problem could be solved by weiler-atherton algorithm.


RULES FOR PROCESSING THIS ALGORITHM

• Polygon-processing direction (clockwise or counterclockwise)

• The pair of polygon vertices follow outside-to-inside scheme or an


inside-to-outside scheme.

For clockwise processing of polygon vertices, we use the following rules:

• For an outside-to-inside pair of vertices, follow polygon boundaries.

• For an inside-to-outside pair of vertices, follow window boundaries in a


clockwise direction.
Let the clipping window be initially called clip
polygon and the polygon to be clipped the
subject polygon.We start with an arbitrary
vertex of the subject polygon and trace around
its border in the clockwise direction until an
intersection with the clip polygon is
encountered:

1. If the edge enters the clip polygon, record


the intersection point and continue to trace the
subject polygon.

2. If the edge leaves the clip polygon, record


the intersection point and make a right turn to
follow the clip polygon in the same manner (i.e.,
treat the clip polygon as subject polygon and the
subject polygon as clip polygon and proceed as
before).Whenever our path of traversal forms a
sub-polygon we output the sub-polygon as part
of the overall result.
Here we will have two columns mainly, subject
and clip.

In the subject column we will mention all the


vertices of the subject polygon including the
intersections.

In the clip column we will mention the clip


window variables, the points inside the clipping
window and the intersection points .

Then we will traverse through the column to find


separate polygons on which we can work on
further and find a sub-polygon.

The disadvantage of this algorithm is that it doesn’t


consider clipping self-intersecting polygons.
THANK YOU!!
SUTHERLAND-HODGEMAN
POLYGON CLIPPING
WHAT IS CLIPPING

When we have to display a large portion of the

picture, then not only scaling & translation is

necessary, the visible part of picture is also

identified. This process is not easy. Certain

parts of the image are inside, while others are

partially inside. The lines or elements which are

partially visible will be omitted.

For deciding the visible and invisible portion, a

particular process called clipping is used.


WHAT IS POLYGON
CLIPPING

Polygon clipping is defined by


Liang and Barsky (1983) as
the process of removing those
parts of a polygon that lie
outside a clipping window. A
polygon clipping algorithm
receives a polygon and a
clipping window
SUTHERLAND-HODGEMAN POLYGON CLIPPING:
It is performed by processing the boundary of polygon against each window corner or edge.
First of all entire polygon is clipped against one edge, then resulting polygon is considered,
then the polygon is considered against the second edge, so on for all four edges.

Four possible situations while processing


1.If the first vertex is an outside the window, the second vertex is
inside the window. Then second vertex is added to the output list.
The point of intersection of window boundary and polygon side
(edge) is also added to the output line.
2.If both vertexes are inside window boundary. Then only second
vertex is added to the output list.
3.If the first vertex is inside the window and second is an outside
window. The edge which intersects with window is added to output
list.
4.If both vertices are the outside window, then nothing is added to
output list.
FOLLOWING
FIGURES
SHOWS
ORIGINAL
POLYGON AND
CLIPPING OF
POLYGON
AGAINST
FOUR
WINDOWS.
AMUSEMENTS
DISADVANTAGES

This method requires a considerable amount of


memory. The first of all polygons are stored in
original form. Then clipping against left edge
done and output is stored. Then clipping
against right edge done, then top edge. Finally,
the bottom edge is clipped. Results of all these
operations are stored in memory. So wastage
of memory for storing intermediate polygons.
THANK YOU
BY :- SUHAS MALHOTRA & SUMIT DIXIT
Weiler – Atherton
Polygon Clipping
Algorithm

By-Tejas Jain and Tanmay Taneja


2K20/CO/460 2K20/CO/456

Computer Graphics Project


Overview

The Weiler–Atherton is a polygon-clipping algorithm. It is used in areas like


computer graphics and games development where clipping of polygons is
needed. It allows clipping of a subject or candidate polygon by an
arbitrarily shaped clipping polygon/area/region.

It is generally applicable only in 2D. However, it can be used in 3D through


visible surface determination and with improved efficiency through Z-
ordering.

It is an improved form of Sutherland – Hodgeman Polygon Clipping Method


which provides accurate results for convex polygons. Weiler's method
provides better results for concave polygons.
Project objective

Weiler Atherton Polygon Clipping Algorithm is


an algorithm made to allow clipping of even
concave algorithms to be possible.

Unlike Sutherland – Hodgman polygon clipping


algorithm, this algorithm is able to clip
concave polygons without leaving any residue
behind.
Understanding the Problem and Solution
1. First make a list of all intersection points.
2. Classify those intersection points as entering or exiting.
3. Now, make two lists, for the clipping polygon, and the the clipped polygon.
4. Fill both the lists such that the intersection points lie between the correct
vertices.
5. Now, start at the 'to be clipped' polygon's list.
6. Choose the first intersection point which has been labelled as
an entering point. Follow the points in the list and keep on pushing
them into a vector. Keep following the list until an exiting intersection point is found.
7. Now switch the list to the other list, and find the exiting the intersection that was
previously encountered. Now keep on following the points in this list until the entering
intersection point is found.
8. This vector now formed by pushing all the encountered points in the
two lists, is now the clipped polygon (one of the many clipped
polygons if any of the clipping polygons is concave).
9. Repeat this clipping procedure (i.e. from step 5) until all the
entering intersection points have been visited once.
“PPT contains Animations. View it in
Presentation Mode for Better Experience”
“PPT contains Animations. View it in
Presentation Mode for Better Experience”

Line is not the


part of original
Polygon
Some More Examples:

Cohen-Sutherland Wiler-Athurten
Algorithm Algorithm
New Convention:
Intersecting Polygon is called Subject Polygon and
Clipping Windows is called Clip Polygon
Clipping Polygon

Subject Polygon
Step – 01
Finding the Intersection of
Subject Polygon with Clipping
Polygon
Step 02: Marking the intersection point and
Adding the Points of Polygon to table in clockwise
Direction
C2 C3

A A’ B

C
D’
D

E’
E

G F’ F

C1 C4
Step 02: Marking the intersection point and
Adding the Points of Polygon to table in clockwise
Subject Clipping Direction
Polygon Polygon
A C1 C2 C3

A’ F’
A A’ B
B E’
C D’
C
D’ A’
D’
D C2 D
E’ C3
E’
E C4 E

F G F’ F
F’
G C1 C4
Step 03: We traverse through the points until
intersection point is reached
Subject Clipping
Polygon Polygon
A C1 C2 C3

A’ F’
A A’ B
B E’
C D’
C
D’ A’
D’
D C2 D
E’ C3
E’
E C4 E

F G F’ F
F’
G C1 C4
Step 03: We traverse through the points until
intersection point is reached
Subject Clipping
Polygon Polygon
A C1 C2 C3

A’ F’
A A’ B
B E’
C D’
C
D’ A’
D’
D C2 D
E’ C3
E’
E C4 E

F G F’ F
F’
G C1 C4
Step 04: We keep on noting the Points in another
Table until another intersection point is
encountered.
Subject Clipping
Polygon Polygon
A C1 C2 C3

A’ F’
A A’ B
Poly. 1 B E’

A’ C D’
C
D’ A’
D’
D C2 D
E’ C3
E’
E C4 E

F G F’ F
F’
G C1 C4
Step 04: We keep on noting the Points in another
Table until another intersection point is
encountered.
Subject Clipping
Polygon Polygon
A C1 C2 C3

A’ F’
A A’ B
Poly. 1 B E’

A’ C D’
C
B D’ A’
D’
D C2 D
E’ C3
E’
E C4 E

F G F’ F
F’
G C1 C4
Step 04: We keep on noting the Points in another
Table until another intersection point is
encountered.
Subject Clipping
Polygon Polygon
A C1 C2 C3

A’ F’
A A’ B
Poly. 1 B E’

A’ C D’
C
B D’ A’
D’
C D C2 D
E’ C3
E’
E C4 E

F G F’ F
F’
G C1 C4
Step 04: We keep on noting the Points in another
Table until another intersection point is
encountered.
Subject Clipping
Polygon Polygon
A C1 C2 C3

A’ F’
A A’ B
Poly. 1 B E’

A’ C D’
C
B D’ A’
D’
C D C2 D

D’ E’ C3
E’
E C4 E

F G F’ F
F’
G C1 C4
Step 04: Then Move to the Clipping Polygon For
finding the end points.
Subject Clipping
Polygon Polygon
A C1 C2 C3

A’ F’
A A’ B
Poly. 1 B E’

A’ C D’
C
B D’ A’
D’
C D C2 D

D’ E’ C3
E’
E C4 E

F G F’ F
F’
G C1 C4
Step 04: Then Move to the Clipping Polygon For
finding the end points.
Subject Clipping
Polygon Polygon
A C1 C2 C3

A’ F’
A A’ B
Poly. 1 B E’

A’ C D’
C
B D’ A’
D’
C D C2 D

D’ E’ C3
E’
E C4 E
A’
F G F’ F
F’
G C1 C4
Step 05: Further Repeating the Steps 03 & 04 for
all the Points
Subject Clipping
Polygon Polygon
A C1 C2 C3

A’ F’
A A’ B
Poly. 1 B E’

A’ C D’
C
B D’ A’
D’
C D C2 D

D’ E’ C3
E’
E C4 E
A’
F G F’ F
F’
G C1 C4
Step 05: Further Repeating the Steps 03 & 04 for
all the Points
Subject Clipping
Polygon Polygon
A C1 C2 C3

A’ F’
A A’ B
Poly. 1 Poly. 2 B E’

A’ E’ C D’
C
B E D’ A’
D’
C F D C2 D

D’ F’ E’ C3
E’
E C4 E
A’
F G F’ F
F’
G C1 C4
Step 05: Further Repeating the Steps 03 & 04 for
all the Points
Subject Clipping
Polygon Polygon
A C1 C2 C3

A’ F’
A A’ B
Poly. 1 Poly. 2 B E’

A’ E’ C D’
C
B E D’ A’
D’
C F D C2 D

D’ F’ E’ C3
E’
E C4 E
A’
F G F’ F
F’
G C1 C4
Step 05: Further Repeating the Steps 03 & 04 for
all the Points
Subject Clipping
Polygon Polygon
A C1 C2 C3

A’ F’
A A’ B
Poly. 1 Poly. 2 B E’

A’ E’ C D’
C
B E D’ A’
D’
C F D C2 D

D’ F’ E’ C3
E’
E C4 E
A’ E’
F G F’ F
F’
G C1 C4
The Figure we get from Using Polygon-1 Table and
Polygon-2 Table
C2 C3

Poly. 1 Poly. 2 A A’ B

A’ E’
B E C
C F D’
D
D’ F’
A’ E’ E’
E

G F’ F

A’ B E’ C1 C4

C E
F’ F
D’
The Figure we get from Using Polygon-1 Table and
Polygon-2 Table
C2 C3

Poly. 1 Poly. 2
A’ E’
B E
A’ B
C F
D’ F’ C
A’ E’ No extra line like
D’ Cohen-Sutherland
Algorithm

A’ B E’ C1 C4

C E E’
E
F’ F
D’
F’ F
Made By:-
Tejas Jain
2K20/CO/460
&
TANMAY TANEJA
2K20/CO/456
THANK YOU!!!

You might also like