SlideShare a Scribd company logo
1 of 19
Different cases for Line Clipping
1. Both endpoints of the line lie with in the clipping area. This means that the
line is included completely in the clipping area, so that the whole line must be
drawn.
Clip
rectangle
B
A
B
A
1
yfuyf
2
fwgqergeqrg
3
4
5
Sg
6
Conti….
3. Both end points are located outside the clipping area and the line do not intersect the
clipping area. In the case , the line lies completely outside the clipping area and can be
neglected for the scene.
4. Both endpoints are located outside the clipping area and the line intersect the clipping
area. The two intersection points of the line with the clipping are must be determined.
Only the part of the line between these two intersection points should be drawn.
C
D’
B
A
G’
H'
Clip
rectangle
B
A
D
D’
C
G’
H'
G
H
I’
I
J’
J
E
F
7
8
Iuutcordi
9
Mid point subdivision algorithm
 This method divide the line into three category:
I. Category 1: Visible line
II. Category 2: not visible line
III. Category 3: candidate for Clipping.
An alternative way to process a line in category 3 is based on binary
search.The line is divided at its midpointsinto two shorter line segments.
Each line in a category three is divided again into shorter segments and
categorized.This bisection and categorization process continue until eavh
line segment that spans across a window boundary reaches a threshold for
line size and all other segments are either in a category 1 (visible) or in
category 2 (Not visible.)
10
11
jftyf
12
Comparison b/w Cohen-Sutherland and Mid-point subdivision clipping Algorithm
• Midpoint subdivision algorithm is a special case of Cohen-sutherland algorithm,
where the intersection is not computed by equation solving. It is computed by a
midpoint approximation method, which is suitable for hardware and it is very
fast and efficient.
• The maximum time is consume in the clipping process is to do intersection calculation
with the window boundaries.
• The Cohen-sutherland algorithm reduces these calculation by first discarding that lines
those can be trivially accepted or rejected.
13
Polygon Clipping
 The simplest curve is a line segment or simply a line. A sequence of line where the
following line starts where the previous one ends is called a polyline. If the last line
segment of the polyline ends where the first line segment started, the polyline is called
a polygon. A polygon is defined by n number of sides in the polygon. We can divide
polygon into two classes.
 A convex polygon is a polygon such that for any two points inside the polygon , all
the point of the line segment connecting them are also inside the polygon. A triangle
is always a convex one.
Polygon
Convex
Polygon
Concave
Polygon
P
Q
14
Conti…
 A Concave polygon is one which is not convex.. A polygon is said to be a concave
if the line joining any two interior points of the polygon does not lies completely
inside the polygon.
 There are four possible cases when processes vertices in sequence around the
parameter of the polygon. As each pair of adjacent polygon vertices is passed to a
window boundary clipper. We make the following test.
P
Q
15
Conti…
 Case 1: If the first vertex is outside the window boundary and second vertex
is inside the window boundary then both the intersection point of a polygon
edge with the window boundary and second vertex are added to the output
vertex list.
 Case 2: If both input vertices are inside the window boundary. Only the
second vertex is added to the Vertex list
Case3: If the first vertex is inside the window boundary and the second
vertex is outside the window boundary then only the edge intersection with the
window boundary is added to the output vertex list.
 Case 4: If both the input vertices are outside the window boundary then
nothing is save to the output list.
16
SUTHERLAND AND HODGEMAN
ALGORITHM(Polygon clipping)
 Polygon clipping is a process of clipping a polygon by considering
the edge of that as different line segments. If a polygon is clipped
against a rectangular window then it is possible that we get various
unconnected edges of a polygon. To get a closed polygon of unconnected
edges we connect theses edges along the side of a clipping window to
form a closed polygon.
 The Sutherland –Hodgeman polygon clipping algorithm clips polygon
against convex clipping windows. The Sutherland Hodgeman Polygon
clipping algorithm may produce connecting lines that were not in the
original polygon. When the subject polygon is concave theses connecting
lines may be undesirable artifacts.
 There are four situation to save vertices in output vertex list.
17
Conti……
1. If the first vertex is outside the window boundary and second vertex is inside the
window boundary then both the intersection point of a polygon edge with the
window boundary and second vertex are added to the output vertex list.Ex:save v1’,v2.
POLYGON
WINDOW(W)
2. If both input vertices are inside the window boundary. Only the second vertex is
added to the Vertex list
POLYGON
WINDOW(w)
V1
V1’
V2
V1
V2
18
Cont…..
3. If the first vertex is inside the window boundary and the second vertex is
outside the window boundary then only the edge intersection with the
window boundary is added to the output vertex list.Ex: v1’, v1.
POLYGON
WINDOW(W)
4. If both the input vertices are outside the window boundary then nothing is
save to the output list.
POLYGON
WINDOW(W)
’
V2
V1
V2
V1’
V1
19

More Related Content

Similar to jd.pptx (20)

iuyf.pptx
iuyf.pptxiuyf.pptx
iuyf.pptx
 
yutd65.pptx
yutd65.pptxyutd65.pptx
yutd65.pptx
 
ytt.pptx
ytt.pptxytt.pptx
ytt.pptx
 
ydyu.pptx
ydyu.pptxydyu.pptx
ydyu.pptx
 
ibuib.pptx
ibuib.pptxibuib.pptx
ibuib.pptx
 
ohu.pptx
ohu.pptxohu.pptx
ohu.pptx
 
kgv.pptx
kgv.pptxkgv.pptx
kgv.pptx
 
Polygon clipping
Polygon clippingPolygon clipping
Polygon clipping
 
Clipping2
Clipping2Clipping2
Clipping2
 
Sutherland hodgman polygon clipping algorithm
Sutherland hodgman polygon clipping algorithmSutherland hodgman polygon clipping algorithm
Sutherland hodgman polygon clipping algorithm
 
99995327.ppt
99995327.ppt99995327.ppt
99995327.ppt
 
Clipping
ClippingClipping
Clipping
 
Clipping
ClippingClipping
Clipping
 
Liang- Barsky Algorithm, Polygon clipping & pipeline clipping of polygons
Liang- Barsky Algorithm, Polygon clipping & pipeline clipping of polygonsLiang- Barsky Algorithm, Polygon clipping & pipeline clipping of polygons
Liang- Barsky Algorithm, Polygon clipping & pipeline clipping of polygons
 
Clipping
ClippingClipping
Clipping
 
Lecture 2d point,curve,text,line clipping
Lecture   2d point,curve,text,line clippingLecture   2d point,curve,text,line clipping
Lecture 2d point,curve,text,line clipping
 
lecture8 clipping
lecture8 clippinglecture8 clipping
lecture8 clipping
 
Clipping computer graphics
Clipping  computer graphicsClipping  computer graphics
Clipping computer graphics
 
Clipping
ClippingClipping
Clipping
 
Windowing clipping
Windowing   clippingWindowing   clipping
Windowing clipping
 

Recently uploaded

VIP Russian Call Girls in Bhilai Deepika 8250192130 Independent Escort Servic...
VIP Russian Call Girls in Bhilai Deepika 8250192130 Independent Escort Servic...VIP Russian Call Girls in Bhilai Deepika 8250192130 Independent Escort Servic...
VIP Russian Call Girls in Bhilai Deepika 8250192130 Independent Escort Servic...Suhani Kapoor
 
阿德莱德大学本科毕业证成绩单咨询(书英文硕士学位证)
阿德莱德大学本科毕业证成绩单咨询(书英文硕士学位证)阿德莱德大学本科毕业证成绩单咨询(书英文硕士学位证)
阿德莱德大学本科毕业证成绩单咨询(书英文硕士学位证)obuhobo
 
内布拉斯加大学林肯分校毕业证录取书( 退学 )学位证书硕士
内布拉斯加大学林肯分校毕业证录取书( 退学 )学位证书硕士内布拉斯加大学林肯分校毕业证录取书( 退学 )学位证书硕士
内布拉斯加大学林肯分校毕业证录取书( 退学 )学位证书硕士obuhobo
 
do's and don'ts in Telephone Interview of Job
do's and don'ts in Telephone Interview of Jobdo's and don'ts in Telephone Interview of Job
do's and don'ts in Telephone Interview of JobRemote DBA Services
 
VIP Call Girls Service Jamshedpur Aishwarya 8250192130 Independent Escort Ser...
VIP Call Girls Service Jamshedpur Aishwarya 8250192130 Independent Escort Ser...VIP Call Girls Service Jamshedpur Aishwarya 8250192130 Independent Escort Ser...
VIP Call Girls Service Jamshedpur Aishwarya 8250192130 Independent Escort Ser...Suhani Kapoor
 
加利福尼亚大学伯克利分校硕士毕业证成绩单(价格咨询)学位证书pdf
加利福尼亚大学伯克利分校硕士毕业证成绩单(价格咨询)学位证书pdf加利福尼亚大学伯克利分校硕士毕业证成绩单(价格咨询)学位证书pdf
加利福尼亚大学伯克利分校硕士毕业证成绩单(价格咨询)学位证书pdfobuhobo
 
VIP Call Girls Firozabad Aaradhya 8250192130 Independent Escort Service Firoz...
VIP Call Girls Firozabad Aaradhya 8250192130 Independent Escort Service Firoz...VIP Call Girls Firozabad Aaradhya 8250192130 Independent Escort Service Firoz...
VIP Call Girls Firozabad Aaradhya 8250192130 Independent Escort Service Firoz...Suhani Kapoor
 
Sonam +91-9537192988-Mind-blowing skills and techniques of Ahmedabad Call Girls
Sonam +91-9537192988-Mind-blowing skills and techniques of Ahmedabad Call GirlsSonam +91-9537192988-Mind-blowing skills and techniques of Ahmedabad Call Girls
Sonam +91-9537192988-Mind-blowing skills and techniques of Ahmedabad Call GirlsNiya Khan
 
How to Find the Best NEET Coaching in Indore (2).pdf
How to Find the Best NEET Coaching in Indore (2).pdfHow to Find the Best NEET Coaching in Indore (2).pdf
How to Find the Best NEET Coaching in Indore (2).pdfmayank158542
 
PM Job Search Council Info Session - PMI Silver Spring Chapter
PM Job Search Council Info Session - PMI Silver Spring ChapterPM Job Search Council Info Session - PMI Silver Spring Chapter
PM Job Search Council Info Session - PMI Silver Spring ChapterHector Del Castillo, CPM, CPMM
 
Black and White Minimalist Co Letter.pdf
Black and White Minimalist Co Letter.pdfBlack and White Minimalist Co Letter.pdf
Black and White Minimalist Co Letter.pdfpadillaangelina0023
 
Dubai Call Girls Naija O525547819 Call Girls In Dubai Home Made
Dubai Call Girls Naija O525547819 Call Girls In Dubai Home MadeDubai Call Girls Naija O525547819 Call Girls In Dubai Home Made
Dubai Call Girls Naija O525547819 Call Girls In Dubai Home Madekojalkojal131
 
Storytelling, Ethics and Workflow in Documentary Photography
Storytelling, Ethics and Workflow in Documentary PhotographyStorytelling, Ethics and Workflow in Documentary Photography
Storytelling, Ethics and Workflow in Documentary PhotographyOrtega Alikwe
 
VIP Russian Call Girls Amravati Chhaya 8250192130 Independent Escort Service ...
VIP Russian Call Girls Amravati Chhaya 8250192130 Independent Escort Service ...VIP Russian Call Girls Amravati Chhaya 8250192130 Independent Escort Service ...
VIP Russian Call Girls Amravati Chhaya 8250192130 Independent Escort Service ...Suhani Kapoor
 
定制(UOIT学位证)加拿大安大略理工大学毕业证成绩单原版一比一
 定制(UOIT学位证)加拿大安大略理工大学毕业证成绩单原版一比一 定制(UOIT学位证)加拿大安大略理工大学毕业证成绩单原版一比一
定制(UOIT学位证)加拿大安大略理工大学毕业证成绩单原版一比一Fs sss
 
定制(Waikato毕业证书)新西兰怀卡托大学毕业证成绩单原版一比一
定制(Waikato毕业证书)新西兰怀卡托大学毕业证成绩单原版一比一定制(Waikato毕业证书)新西兰怀卡托大学毕业证成绩单原版一比一
定制(Waikato毕业证书)新西兰怀卡托大学毕业证成绩单原版一比一Fs
 
Ioannis Tzachristas Self-Presentation for MBA.pdf
Ioannis Tzachristas Self-Presentation for MBA.pdfIoannis Tzachristas Self-Presentation for MBA.pdf
Ioannis Tzachristas Self-Presentation for MBA.pdfjtzach
 
Preventing and ending sexual harassment in the workplace.pptx
Preventing and ending sexual harassment in the workplace.pptxPreventing and ending sexual harassment in the workplace.pptx
Preventing and ending sexual harassment in the workplace.pptxGry Tina Tinde
 
Delhi Call Girls In Atta Market 9711199012 Book Your One night Stand Call Girls
Delhi Call Girls In Atta Market 9711199012 Book Your One night Stand Call GirlsDelhi Call Girls In Atta Market 9711199012 Book Your One night Stand Call Girls
Delhi Call Girls In Atta Market 9711199012 Book Your One night Stand Call Girlsshivangimorya083
 

Recently uploaded (20)

VIP Russian Call Girls in Bhilai Deepika 8250192130 Independent Escort Servic...
VIP Russian Call Girls in Bhilai Deepika 8250192130 Independent Escort Servic...VIP Russian Call Girls in Bhilai Deepika 8250192130 Independent Escort Servic...
VIP Russian Call Girls in Bhilai Deepika 8250192130 Independent Escort Servic...
 
阿德莱德大学本科毕业证成绩单咨询(书英文硕士学位证)
阿德莱德大学本科毕业证成绩单咨询(书英文硕士学位证)阿德莱德大学本科毕业证成绩单咨询(书英文硕士学位证)
阿德莱德大学本科毕业证成绩单咨询(书英文硕士学位证)
 
内布拉斯加大学林肯分校毕业证录取书( 退学 )学位证书硕士
内布拉斯加大学林肯分校毕业证录取书( 退学 )学位证书硕士内布拉斯加大学林肯分校毕业证录取书( 退学 )学位证书硕士
内布拉斯加大学林肯分校毕业证录取书( 退学 )学位证书硕士
 
do's and don'ts in Telephone Interview of Job
do's and don'ts in Telephone Interview of Jobdo's and don'ts in Telephone Interview of Job
do's and don'ts in Telephone Interview of Job
 
VIP Call Girls Service Jamshedpur Aishwarya 8250192130 Independent Escort Ser...
VIP Call Girls Service Jamshedpur Aishwarya 8250192130 Independent Escort Ser...VIP Call Girls Service Jamshedpur Aishwarya 8250192130 Independent Escort Ser...
VIP Call Girls Service Jamshedpur Aishwarya 8250192130 Independent Escort Ser...
 
加利福尼亚大学伯克利分校硕士毕业证成绩单(价格咨询)学位证书pdf
加利福尼亚大学伯克利分校硕士毕业证成绩单(价格咨询)学位证书pdf加利福尼亚大学伯克利分校硕士毕业证成绩单(价格咨询)学位证书pdf
加利福尼亚大学伯克利分校硕士毕业证成绩单(价格咨询)学位证书pdf
 
FULL ENJOY Call Girls In Gautam Nagar (Delhi) Call Us 9953056974
FULL ENJOY Call Girls In Gautam Nagar (Delhi) Call Us 9953056974FULL ENJOY Call Girls In Gautam Nagar (Delhi) Call Us 9953056974
FULL ENJOY Call Girls In Gautam Nagar (Delhi) Call Us 9953056974
 
VIP Call Girls Firozabad Aaradhya 8250192130 Independent Escort Service Firoz...
VIP Call Girls Firozabad Aaradhya 8250192130 Independent Escort Service Firoz...VIP Call Girls Firozabad Aaradhya 8250192130 Independent Escort Service Firoz...
VIP Call Girls Firozabad Aaradhya 8250192130 Independent Escort Service Firoz...
 
Sonam +91-9537192988-Mind-blowing skills and techniques of Ahmedabad Call Girls
Sonam +91-9537192988-Mind-blowing skills and techniques of Ahmedabad Call GirlsSonam +91-9537192988-Mind-blowing skills and techniques of Ahmedabad Call Girls
Sonam +91-9537192988-Mind-blowing skills and techniques of Ahmedabad Call Girls
 
How to Find the Best NEET Coaching in Indore (2).pdf
How to Find the Best NEET Coaching in Indore (2).pdfHow to Find the Best NEET Coaching in Indore (2).pdf
How to Find the Best NEET Coaching in Indore (2).pdf
 
PM Job Search Council Info Session - PMI Silver Spring Chapter
PM Job Search Council Info Session - PMI Silver Spring ChapterPM Job Search Council Info Session - PMI Silver Spring Chapter
PM Job Search Council Info Session - PMI Silver Spring Chapter
 
Black and White Minimalist Co Letter.pdf
Black and White Minimalist Co Letter.pdfBlack and White Minimalist Co Letter.pdf
Black and White Minimalist Co Letter.pdf
 
Dubai Call Girls Naija O525547819 Call Girls In Dubai Home Made
Dubai Call Girls Naija O525547819 Call Girls In Dubai Home MadeDubai Call Girls Naija O525547819 Call Girls In Dubai Home Made
Dubai Call Girls Naija O525547819 Call Girls In Dubai Home Made
 
Storytelling, Ethics and Workflow in Documentary Photography
Storytelling, Ethics and Workflow in Documentary PhotographyStorytelling, Ethics and Workflow in Documentary Photography
Storytelling, Ethics and Workflow in Documentary Photography
 
VIP Russian Call Girls Amravati Chhaya 8250192130 Independent Escort Service ...
VIP Russian Call Girls Amravati Chhaya 8250192130 Independent Escort Service ...VIP Russian Call Girls Amravati Chhaya 8250192130 Independent Escort Service ...
VIP Russian Call Girls Amravati Chhaya 8250192130 Independent Escort Service ...
 
定制(UOIT学位证)加拿大安大略理工大学毕业证成绩单原版一比一
 定制(UOIT学位证)加拿大安大略理工大学毕业证成绩单原版一比一 定制(UOIT学位证)加拿大安大略理工大学毕业证成绩单原版一比一
定制(UOIT学位证)加拿大安大略理工大学毕业证成绩单原版一比一
 
定制(Waikato毕业证书)新西兰怀卡托大学毕业证成绩单原版一比一
定制(Waikato毕业证书)新西兰怀卡托大学毕业证成绩单原版一比一定制(Waikato毕业证书)新西兰怀卡托大学毕业证成绩单原版一比一
定制(Waikato毕业证书)新西兰怀卡托大学毕业证成绩单原版一比一
 
Ioannis Tzachristas Self-Presentation for MBA.pdf
Ioannis Tzachristas Self-Presentation for MBA.pdfIoannis Tzachristas Self-Presentation for MBA.pdf
Ioannis Tzachristas Self-Presentation for MBA.pdf
 
Preventing and ending sexual harassment in the workplace.pptx
Preventing and ending sexual harassment in the workplace.pptxPreventing and ending sexual harassment in the workplace.pptx
Preventing and ending sexual harassment in the workplace.pptx
 
Delhi Call Girls In Atta Market 9711199012 Book Your One night Stand Call Girls
Delhi Call Girls In Atta Market 9711199012 Book Your One night Stand Call GirlsDelhi Call Girls In Atta Market 9711199012 Book Your One night Stand Call Girls
Delhi Call Girls In Atta Market 9711199012 Book Your One night Stand Call Girls
 

jd.pptx

  • 1. Different cases for Line Clipping 1. Both endpoints of the line lie with in the clipping area. This means that the line is included completely in the clipping area, so that the whole line must be drawn. Clip rectangle B A B A 1
  • 4. 4
  • 5. 5
  • 7. Conti…. 3. Both end points are located outside the clipping area and the line do not intersect the clipping area. In the case , the line lies completely outside the clipping area and can be neglected for the scene. 4. Both endpoints are located outside the clipping area and the line intersect the clipping area. The two intersection points of the line with the clipping are must be determined. Only the part of the line between these two intersection points should be drawn. C D’ B A G’ H' Clip rectangle B A D D’ C G’ H' G H I’ I J’ J E F 7
  • 8. 8
  • 10. Mid point subdivision algorithm  This method divide the line into three category: I. Category 1: Visible line II. Category 2: not visible line III. Category 3: candidate for Clipping. An alternative way to process a line in category 3 is based on binary search.The line is divided at its midpointsinto two shorter line segments. Each line in a category three is divided again into shorter segments and categorized.This bisection and categorization process continue until eavh line segment that spans across a window boundary reaches a threshold for line size and all other segments are either in a category 1 (visible) or in category 2 (Not visible.) 10
  • 11. 11
  • 13. Comparison b/w Cohen-Sutherland and Mid-point subdivision clipping Algorithm • Midpoint subdivision algorithm is a special case of Cohen-sutherland algorithm, where the intersection is not computed by equation solving. It is computed by a midpoint approximation method, which is suitable for hardware and it is very fast and efficient. • The maximum time is consume in the clipping process is to do intersection calculation with the window boundaries. • The Cohen-sutherland algorithm reduces these calculation by first discarding that lines those can be trivially accepted or rejected. 13
  • 14. Polygon Clipping  The simplest curve is a line segment or simply a line. A sequence of line where the following line starts where the previous one ends is called a polyline. If the last line segment of the polyline ends where the first line segment started, the polyline is called a polygon. A polygon is defined by n number of sides in the polygon. We can divide polygon into two classes.  A convex polygon is a polygon such that for any two points inside the polygon , all the point of the line segment connecting them are also inside the polygon. A triangle is always a convex one. Polygon Convex Polygon Concave Polygon P Q 14
  • 15. Conti…  A Concave polygon is one which is not convex.. A polygon is said to be a concave if the line joining any two interior points of the polygon does not lies completely inside the polygon.  There are four possible cases when processes vertices in sequence around the parameter of the polygon. As each pair of adjacent polygon vertices is passed to a window boundary clipper. We make the following test. P Q 15
  • 16. Conti…  Case 1: If the first vertex is outside the window boundary and second vertex is inside the window boundary then both the intersection point of a polygon edge with the window boundary and second vertex are added to the output vertex list.  Case 2: If both input vertices are inside the window boundary. Only the second vertex is added to the Vertex list Case3: If the first vertex is inside the window boundary and the second vertex is outside the window boundary then only the edge intersection with the window boundary is added to the output vertex list.  Case 4: If both the input vertices are outside the window boundary then nothing is save to the output list. 16
  • 17. SUTHERLAND AND HODGEMAN ALGORITHM(Polygon clipping)  Polygon clipping is a process of clipping a polygon by considering the edge of that as different line segments. If a polygon is clipped against a rectangular window then it is possible that we get various unconnected edges of a polygon. To get a closed polygon of unconnected edges we connect theses edges along the side of a clipping window to form a closed polygon.  The Sutherland –Hodgeman polygon clipping algorithm clips polygon against convex clipping windows. The Sutherland Hodgeman Polygon clipping algorithm may produce connecting lines that were not in the original polygon. When the subject polygon is concave theses connecting lines may be undesirable artifacts.  There are four situation to save vertices in output vertex list. 17
  • 18. Conti…… 1. If the first vertex is outside the window boundary and second vertex is inside the window boundary then both the intersection point of a polygon edge with the window boundary and second vertex are added to the output vertex list.Ex:save v1’,v2. POLYGON WINDOW(W) 2. If both input vertices are inside the window boundary. Only the second vertex is added to the Vertex list POLYGON WINDOW(w) V1 V1’ V2 V1 V2 18
  • 19. Cont….. 3. If the first vertex is inside the window boundary and the second vertex is outside the window boundary then only the edge intersection with the window boundary is added to the output vertex list.Ex: v1’, v1. POLYGON WINDOW(W) 4. If both the input vertices are outside the window boundary then nothing is save to the output list. POLYGON WINDOW(W) ’ V2 V1 V2 V1’ V1 19