1 / 113

Clipping Polygons

This article explores why polygon clipping is difficult and covers the Sutherland-Hodgman algorithm for clipping polygons. It discusses possible outcomes, concave polygons, and the input/output of the algorithm.

jrichmond
Download Presentation

Clipping Polygons

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Clipping Polygons Dr. Scott Schaefer

  2. Clipping Polygons

  3. Clipping Polygons

  4. Why Is Polygon Clipping Hard? • What happens to a triangle during clipping? - possible outcomes: triangle triangle triangle quad triangle 5-gon

  5. Why Is Polygon Clipping Hard? • What happens to a triangle during clipping? - possible outcomes: triangle triangle triangle quad triangle 5-gon How many sides could a clipped triangle have?

  6. How Many Sides? 7

  7. Why Is Polygon Clipping Hard? Concave polygon Multiple polygons

  8. Why Is Polygon Clipping Hard? • A really tough case

  9. Sutherland-Hodgman Clipping • Basic idea: - consider each edge of the view window individually - clip the polygon against the view window edge’s equation

  10. Sutherland-Hodgman Clipping • Basic idea: - consider each edge of the view window individually - clip the polygon against the view window edge’s equation

  11. Sutherland-Hodgman Clipping • Basic idea: - consider each edge of the view window individually - clip the polygon against the view window edge’s equation

  12. Sutherland-Hodgman Clipping • Basic idea: - consider each edge of the view window individually - clip the polygon against the view window edge’s equation

  13. Sutherland-Hodgman Clipping • Basic idea: - consider each edge of the view window individually - clip the polygon against the view window edge’s equation

  14. Sutherland-Hodgman Clipping • Basic idea: - consider each edge of the view window individually - clip the polygon against the view window edge’s equation

  15. Sutherland-Hodgman Clipping • Basic idea: - consider each edge of the view window individually - clip the polygon against the view window edge’s equation

  16. Sutherland-Hodgman Clipping • Basic idea: - consider each edge of the view window individually - clip the polygon against the view window edge’s equation

  17. Sutherland-Hodgman Clipping • Basic idea: - consider each edge of the view window individually - clip the polygon against the view window edge’s equation

  18. Sutherland-Hodgman Clipping • Basic idea: - consider each edge of the view window individually - clip the polygon against the view window edge’s equation - after doing all edges, the polygon is fully clipped

  19. Sutherland-Hodgman Clipping • Input/output for algorithm: - input: list of polygon vertices in order {abcdef} a f b e d c

  20. Sutherland-Hodgman Clipping • Input/output for algorithm: - input: list of polygon vertices in order - output: list of clipped polygon vertices consisting of old vertices (maybe) and new vertices (maybe)

  21. outside inside outside inside S E E S I outputE output no output Sutherland-Hodgman Clipping • Edge from S to E takes one of four cases: outside inside outside inside E S E S E output I output

  22. Out In Out In Out In Out In Output I,E No output Output E Output I Sutherland-Hodgman Algorithm

  23. Out In Out In Out In Out In Output I,E No output Output E Output I Sutherland-Hodgman Algorithm

  24. Out In Out In Out In Out In Output I,E No output Output E Output I Sutherland-Hodgman Algorithm

  25. Out In Out In Out In Out In Output I,E No output Output E Output I Sutherland-Hodgman Algorithm

  26. Out In Out In Out In Out In Output I,E No output Output E Output I Sutherland-Hodgman Algorithm

  27. Out In Out In Out In Out In Output I,E No output Output E Output I Sutherland-Hodgman Algorithm

  28. Out In Out In Out In Out In Output I,E No output Output E Output I Sutherland-Hodgman Algorithm b

  29. Out In Out In Out In Out In Output I,E No output Output E Output I Sutherland-Hodgman Algorithm

  30. Out In Out In Out In Out In Output I,E No output Output E Output I Sutherland-Hodgman Algorithm

  31. Out In Out In Out In Out In Output I,E No output Output E Output I Sutherland-Hodgman Algorithm

  32. Out In Out In Out In Out In Output I,E No output Output E Output I Sutherland-Hodgman Algorithm

  33. Out In Out In Out In Out In Output I,E No output Output E Output I Sutherland-Hodgman Algorithm

  34. Out In Out In Out In Out In Output I,E No output Output E Output I Sutherland-Hodgman Algorithm

  35. Out In Out In Out In Out In Output I,E No output Output E Output I Sutherland-Hodgman Algorithm

  36. Out In Out In Out In Out In Output I,E No output Output E Output I Sutherland-Hodgman Algorithm

  37. Out In Out In Out In Out In Output I,E No output Output E Output I Sutherland-Hodgman Algorithm

  38. Out In Out In Out In Out In Output I,E No output Output E Output I Sutherland-Hodgman Algorithm

  39. Out In Out In Out In Out In Output I,E No output Output E Output I Sutherland-Hodgman Algorithm

  40. Out In Out In Out In Out In Output I,E No output Output E Output I Sutherland-Hodgman Algorithm

  41. Out In Out In Out In Out In Output I,E No output Output E Output I Sutherland-Hodgman Algorithm

  42. Out In Out In Out In Out In Output I,E No output Output E Output I Sutherland-Hodgman Algorithm

  43. Out In Out In Out In Out In Output I,E No output Output E Output I Sutherland-Hodgman Algorithm

  44. Out In Out In Out In Out In Output I,E No output Output E Output I Sutherland-Hodgman Algorithm

  45. Out In Out In Out In Out In Output I,E No output Output E Output I Sutherland-Hodgman Algorithm

  46. Out In Out In Out In Out In Output I,E No output Output E Output I Sutherland-Hodgman Algorithm

  47. Out In Out In Out In Out In Output I,E No output Output E Output I Sutherland-Hodgman Algorithm

  48. Out In Out In Out In Out In Output I,E No output Output E Output I Sutherland-Hodgman Algorithm

  49. Out In Out In Out In Out In Output I,E No output Output E Output I Sutherland-Hodgman Algorithm

  50. Out In Out In Out In Out In Output I,E No output Output E Output I Sutherland-Hodgman Algorithm

More Related