SlideShare a Scribd company logo
1 of 18
Computer Graphics
Clipping
โ€ข Sutherland-Hodgman Algorithm (Area Clipping or Polygon Clipping)
โ€ข Weiler-Atherton Polygon Clipping (Solution of Sutherland-Hodgman
Algorithm )
โ€ข Cohen Sutherland Algorithm (Line Clipping)
2
Area Clipping (polygons)
To clip a polygon, we cannot directly apply
a line-clipping method to the individual
polygon edges because this approach would
produce a series of unconnected line
segments as shown in figure .
3
Area Clipping (polygons)
The clipped polygons must be a bounded area after
clipping 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 output of a polygon clipper should be a
sequence of vertices that defines the clipped
polygon boundaries.
Concave Polygon
4
Sutherland-Hodgman Polygon Clipping
โ€ขClip a polygon by processing the polygon boundary
against each window edge. (Left, Top, Bottom, Right).
โ€ข Apply four cases to process all polygon edges to
produce sequence of vertices. This sequence of
vertices will make a bounded area.
โ€ข Beginning with the initial set of polygon vertices, we
could first clip the polygon against the left rectangle
boundary to produce a new sequence of vertices.
โ€ข The new set of vertices could be successively passed
to a right boundary clipper, a bottom boundary clipper,
and a top boundary clipper.
5
Sutherland-Hodgman Polygon Clipping
Lift
Clipper
Right
Clipper
Bottom
Clipper
Top
Clipper
At each step, a new sequence
of output vertices is generated
and passed to the next window
boundary clipper.
6
Sutherland-Hodgman Polygon Clipping
There are four possible cases when processing
vertices in sequence around the perimeter of a
polygon.
As each pair of adjacent polygon vertices is
passed to a next window boundary clipper, we
make the following tests:
7
Sutherland-Hodgman Polygon Clipping
1. If the first vertex is outside the window
boundary and the second vertex is inside
Then , both the intersection point of the
polygon edge with the window boundary
and the second vertex are added to the
output vertex list.
8
Sutherland-Hodgman Polygon Clipping
2. If both input vertices are inside the
window boundary.
Then, only the second vertex is added to
the output vertex list.
9
Sutherland-Hodgman Polygon Clipping
3. If the first vertex is inside the window
boundary and the second vertex is
outside.
Then, only the edge intersection with the
window boundary is added to the output
vertex list.
10
Sutherland-Hodgman Polygon Clipping
4. If both input vertices are outside the
window boundary.
Then, nothing is added to the output vertex
list.
11
Sutherland-Hodgman Polygon Clipping (Example)
We illustrate this algorithm by processing the area in
figure against the left window boundary.
Vertices 1 and 2 are outside of the
boundary.
Vertex 3, which is inside, 1' and
vertex 3 are saved.
Vertex 4 and 5 are inside, and they
also saved.
Vertex 6 is outside, 5' is saved.
Using the five saved points, we
would repeat the process for the
next window boundary.
12
Sutherland-Hodgman Polygon Clipping
The Sutherland-Hodgman algorithm correctly
clips convex polygons, but concave polygons
may be displayed with extraneous lines as
demonstrated in figure.
Since there is only one output vertex list, the last
vertex in the list is always joined to the first
vertex.
Sutherland-Hodgman Polygon Clipping
Complexity Of this algorithm will increase if number of edges of
polygon increase. Algorithm has to calculate more number of
intersection points over window boundary.
14
Weiler-Atherton Polygon Clipping
This algorithm was developed 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 as vertices are
processed, we will follow the window boundaries.
The path we follow depends on:
โ€ข polygon-processing direction (clockwise or
counterclockwise)
โ€ข The pair of polygon vertices
outside-to-inside or an inside-to-outside.
15
Weiler-Atherton Polygon Clipping
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.
16
Weiler-Atherton Polygon Clipping (Example)
Clipped Polygon using sutherland hogman
algorithm with connected component problem
Clipped Polygon using Weiler-Atherton Polygon
Clipping without connected component problem
Thank You

More Related Content

What's hot

Clipping
ClippingClipping
Clipping
Mohd Arif
ย 
Visible surface detection in computer graphic
Visible surface detection in computer graphicVisible surface detection in computer graphic
Visible surface detection in computer graphic
anku2266
ย 
The sutherland hodgeman polygon clipping algorithm
The sutherland hodgeman polygon clipping algorithmThe sutherland hodgeman polygon clipping algorithm
The sutherland hodgeman polygon clipping algorithm
Mani Kanth
ย 
Polygon filling
Polygon fillingPolygon filling
Polygon filling
Ankit Garg
ย 
Hidden surfaces
Hidden surfacesHidden surfaces
Hidden surfaces
Mohd Arif
ย 

What's hot (20)

Unit 3
Unit 3Unit 3
Unit 3
ย 
2 d viewing computer graphics
2 d viewing computer graphics2 d viewing computer graphics
2 d viewing computer graphics
ย 
Attributes of Output Primitives
Attributes of Output PrimitivesAttributes of Output Primitives
Attributes of Output Primitives
ย 
Clipping in Computer Graphics
Clipping in Computer GraphicsClipping in Computer Graphics
Clipping in Computer Graphics
ย 
Clipping
ClippingClipping
Clipping
ย 
Visible surface detection in computer graphic
Visible surface detection in computer graphicVisible surface detection in computer graphic
Visible surface detection in computer graphic
ย 
Graphics_3D viewing
Graphics_3D viewingGraphics_3D viewing
Graphics_3D viewing
ย 
Segments in Graphics
Segments in GraphicsSegments in Graphics
Segments in Graphics
ย 
Clipping
ClippingClipping
Clipping
ย 
Sutherland hodgman polygon clipping algorithm
Sutherland hodgman polygon clipping algorithmSutherland hodgman polygon clipping algorithm
Sutherland hodgman polygon clipping algorithm
ย 
Mid point circle algorithm
Mid point circle algorithmMid point circle algorithm
Mid point circle algorithm
ย 
The sutherland hodgeman polygon clipping algorithm
The sutherland hodgeman polygon clipping algorithmThe sutherland hodgeman polygon clipping algorithm
The sutherland hodgeman polygon clipping algorithm
ย 
Hidden surface removal
Hidden surface removalHidden surface removal
Hidden surface removal
ย 
Polygon filling
Polygon fillingPolygon filling
Polygon filling
ย 
3D Display
3D Display3D Display
3D Display
ย 
Hidden surfaces
Hidden surfacesHidden surfaces
Hidden surfaces
ย 
3 d display methods
3 d display methods3 d display methods
3 d display methods
ย 
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
ย 
Anti- aliasing computer graphics
Anti- aliasing computer graphicsAnti- aliasing computer graphics
Anti- aliasing computer graphics
ย 
Character attributes
Character attributesCharacter attributes
Character attributes
ย 

Similar to Polygon clipping (20)

Clipping2
Clipping2Clipping2
Clipping2
ย 
99995327.ppt
99995327.ppt99995327.ppt
99995327.ppt
ย 
jd.pptx
jd.pptxjd.pptx
jd.pptx
ย 
hgfcgf.pptx
hgfcgf.pptxhgfcgf.pptx
hgfcgf.pptx
ย 
jfcft.pptx
jfcft.pptxjfcft.pptx
jfcft.pptx
ย 
yyfty.pptx
yyfty.pptxyyfty.pptx
yyfty.pptx
ย 
kfty.pptx
kfty.pptxkfty.pptx
kfty.pptx
ย 
ytdty.pptx
ytdty.pptxytdty.pptx
ytdty.pptx
ย 
hgfcftc.pptx
hgfcftc.pptxhgfcftc.pptx
hgfcftc.pptx
ย 
ytsju.pptx
ytsju.pptxytsju.pptx
ytsju.pptx
ย 
iuyf.pptx
iuyf.pptxiuyf.pptx
iuyf.pptx
ย 
ufyty.pptx
ufyty.pptxufyty.pptx
ufyty.pptx
ย 
ibuib.pptx
ibuib.pptxibuib.pptx
ibuib.pptx
ย 
Clipping 22
Clipping 22Clipping 22
Clipping 22
ย 
Clipping 22
Clipping 22Clipping 22
Clipping 22
ย 
Clipping
ClippingClipping
Clipping
ย 
Windowing clipping
Windowing   clippingWindowing   clipping
Windowing clipping
ย 
ohu.pptx
ohu.pptxohu.pptx
ohu.pptx
ย 
Materi_05_CG_2223_2_.pdf
Materi_05_CG_2223_2_.pdfMateri_05_CG_2223_2_.pdf
Materi_05_CG_2223_2_.pdf
ย 
Clipping
ClippingClipping
Clipping
ย 

More from Ankit Garg

Curve clipping
Curve clippingCurve clipping
Curve clipping
Ankit Garg
ย 
Projection ppt
Projection pptProjection ppt
Projection ppt
Ankit Garg
ย 
Numerical unit 1
Numerical unit 1Numerical unit 1
Numerical unit 1
Ankit Garg
ย 
Line drawing algorithm and antialiasing techniques
Line drawing algorithm and antialiasing techniquesLine drawing algorithm and antialiasing techniques
Line drawing algorithm and antialiasing techniques
Ankit Garg
ย 
Line clipping
Line clippingLine clipping
Line clipping
Ankit Garg
ย 
Hidden surface removal
Hidden surface removalHidden surface removal
Hidden surface removal
Ankit Garg
ย 
Graphics software standards
Graphics software standardsGraphics software standards
Graphics software standards
Ankit Garg
ย 
Fractal introduction and applications modified version
Fractal introduction and applications modified versionFractal introduction and applications modified version
Fractal introduction and applications modified version
Ankit Garg
ย 
Digital image processing & computer graphics
Digital image processing & computer graphicsDigital image processing & computer graphics
Digital image processing & computer graphics
Ankit Garg
ย 
Concept of basic illumination model
Concept of basic illumination modelConcept of basic illumination model
Concept of basic illumination model
Ankit Garg
ย 
Circle generation algorithm
Circle generation algorithmCircle generation algorithm
Circle generation algorithm
Ankit Garg
ย 
Character generation
Character generationCharacter generation
Character generation
Ankit Garg
ย 
Applications of cg
Applications of cgApplications of cg
Applications of cg
Ankit Garg
ย 
2 d transformation
2 d transformation2 d transformation
2 d transformation
Ankit Garg
ย 
3 d transformations
3 d transformations3 d transformations
3 d transformations
Ankit Garg
ย 

More from Ankit Garg (18)

Introduction to computer graphics part 2
Introduction to computer graphics part 2Introduction to computer graphics part 2
Introduction to computer graphics part 2
ย 
Introduction to computer graphics part 1
Introduction to computer graphics part 1Introduction to computer graphics part 1
Introduction to computer graphics part 1
ย 
Curve clipping
Curve clippingCurve clipping
Curve clipping
ย 
Unit 1
Unit 1Unit 1
Unit 1
ย 
Projection ppt
Projection pptProjection ppt
Projection ppt
ย 
Numerical unit 1
Numerical unit 1Numerical unit 1
Numerical unit 1
ย 
Line drawing algorithm and antialiasing techniques
Line drawing algorithm and antialiasing techniquesLine drawing algorithm and antialiasing techniques
Line drawing algorithm and antialiasing techniques
ย 
Line clipping
Line clippingLine clipping
Line clipping
ย 
Hidden surface removal
Hidden surface removalHidden surface removal
Hidden surface removal
ย 
Graphics software standards
Graphics software standardsGraphics software standards
Graphics software standards
ย 
Fractal introduction and applications modified version
Fractal introduction and applications modified versionFractal introduction and applications modified version
Fractal introduction and applications modified version
ย 
Digital image processing & computer graphics
Digital image processing & computer graphicsDigital image processing & computer graphics
Digital image processing & computer graphics
ย 
Concept of basic illumination model
Concept of basic illumination modelConcept of basic illumination model
Concept of basic illumination model
ย 
Circle generation algorithm
Circle generation algorithmCircle generation algorithm
Circle generation algorithm
ย 
Character generation
Character generationCharacter generation
Character generation
ย 
Applications of cg
Applications of cgApplications of cg
Applications of cg
ย 
2 d transformation
2 d transformation2 d transformation
2 d transformation
ย 
3 d transformations
3 d transformations3 d transformations
3 d transformations
ย 

Recently uploaded

Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Christo Ananth
ย 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
Tonystark477637
ย 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
ย 
Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar โ‰ผ๐Ÿ” Delhi door step de...
Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar  โ‰ผ๐Ÿ” Delhi door step de...Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar  โ‰ผ๐Ÿ” Delhi door step de...
Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar โ‰ผ๐Ÿ” Delhi door step de...
9953056974 Low Rate Call Girls In Saket, Delhi NCR
ย 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
rknatarajan
ย 
Call Girls in Ramesh Nagar Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
Call Girls in Ramesh Nagar Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort ServiceCall Girls in Ramesh Nagar Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
Call Girls in Ramesh Nagar Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
ย 

Recently uploaded (20)

Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
ย 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
ย 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
ย 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
ย 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
ย 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ย 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
ย 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
ย 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
ย 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
ย 
Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar โ‰ผ๐Ÿ” Delhi door step de...
Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar  โ‰ผ๐Ÿ” Delhi door step de...Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar  โ‰ผ๐Ÿ” Delhi door step de...
Call Now โ‰ฝ 9953056974 โ‰ผ๐Ÿ” Call Girls In New Ashok Nagar โ‰ผ๐Ÿ” Delhi door step de...
ย 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
ย 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
ย 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
ย 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
ย 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
ย 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
ย 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
ย 
Call Girls in Ramesh Nagar Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
Call Girls in Ramesh Nagar Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort ServiceCall Girls in Ramesh Nagar Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
Call Girls in Ramesh Nagar Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
ย 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
ย 

Polygon clipping

  • 1. Computer Graphics Clipping โ€ข Sutherland-Hodgman Algorithm (Area Clipping or Polygon Clipping) โ€ข Weiler-Atherton Polygon Clipping (Solution of Sutherland-Hodgman Algorithm ) โ€ข Cohen Sutherland Algorithm (Line Clipping)
  • 2. 2 Area Clipping (polygons) To clip a polygon, we cannot directly apply a line-clipping method to the individual polygon edges because this approach would produce a series of unconnected line segments as shown in figure .
  • 3. 3 Area Clipping (polygons) The clipped polygons must be a bounded area after clipping 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 output of a polygon clipper should be a sequence of vertices that defines the clipped polygon boundaries. Concave Polygon
  • 4. 4 Sutherland-Hodgman Polygon Clipping โ€ขClip a polygon by processing the polygon boundary against each window edge. (Left, Top, Bottom, Right). โ€ข Apply four cases to process all polygon edges to produce sequence of vertices. This sequence of vertices will make a bounded area. โ€ข Beginning with the initial set of polygon vertices, we could first clip the polygon against the left rectangle boundary to produce a new sequence of vertices. โ€ข The new set of vertices could be successively passed to a right boundary clipper, a bottom boundary clipper, and a top boundary clipper.
  • 5. 5 Sutherland-Hodgman Polygon Clipping Lift Clipper Right Clipper Bottom Clipper Top Clipper At each step, a new sequence of output vertices is generated and passed to the next window boundary clipper.
  • 6. 6 Sutherland-Hodgman Polygon Clipping There are four possible cases when processing vertices in sequence around the perimeter of a polygon. As each pair of adjacent polygon vertices is passed to a next window boundary clipper, we make the following tests:
  • 7. 7 Sutherland-Hodgman Polygon Clipping 1. If the first vertex is outside the window boundary and the second vertex is inside Then , both the intersection point of the polygon edge with the window boundary and the second vertex are added to the output vertex list.
  • 8. 8 Sutherland-Hodgman Polygon Clipping 2. If both input vertices are inside the window boundary. Then, only the second vertex is added to the output vertex list.
  • 9. 9 Sutherland-Hodgman Polygon Clipping 3. If the first vertex is inside the window boundary and the second vertex is outside. Then, only the edge intersection with the window boundary is added to the output vertex list.
  • 10. 10 Sutherland-Hodgman Polygon Clipping 4. If both input vertices are outside the window boundary. Then, nothing is added to the output vertex list.
  • 11. 11 Sutherland-Hodgman Polygon Clipping (Example) We illustrate this algorithm by processing the area in figure against the left window boundary. Vertices 1 and 2 are outside of the boundary. Vertex 3, which is inside, 1' and vertex 3 are saved. Vertex 4 and 5 are inside, and they also saved. Vertex 6 is outside, 5' is saved. Using the five saved points, we would repeat the process for the next window boundary.
  • 12. 12 Sutherland-Hodgman Polygon Clipping The Sutherland-Hodgman algorithm correctly clips convex polygons, but concave polygons may be displayed with extraneous lines as demonstrated in figure. Since there is only one output vertex list, the last vertex in the list is always joined to the first vertex.
  • 13. Sutherland-Hodgman Polygon Clipping Complexity Of this algorithm will increase if number of edges of polygon increase. Algorithm has to calculate more number of intersection points over window boundary.
  • 14. 14 Weiler-Atherton Polygon Clipping This algorithm was developed 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 as vertices are processed, we will follow the window boundaries. The path we follow depends on: โ€ข polygon-processing direction (clockwise or counterclockwise) โ€ข The pair of polygon vertices outside-to-inside or an inside-to-outside.
  • 15. 15 Weiler-Atherton Polygon Clipping 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.
  • 16. 16 Weiler-Atherton Polygon Clipping (Example) Clipped Polygon using sutherland hogman algorithm with connected component problem Clipped Polygon using Weiler-Atherton Polygon Clipping without connected component problem
  • 17.