SlideShare a Scribd company logo
2
Most read
9
Most read
12
Most read
Polygon Clipping
Collection of connected lines is considered as
Polygon. A polygon clipper takes as input the
vertices of a polygon and returns one(or
   more)
polygons. A closed Polygon when clipped
                C
then we may get one or more open c
                                d
                                    polygon or
                  D
lines.                     a
  A
                           b
      B
When we want clipping of a solid polygon
area(closed polygon), then after clipping the
resulting polygon should be closed. It requires
that lines ab & cd be added to make it closed
polygon. Hence it is difficult to find out
   which
pieces of sections should be joined to make
the clipped polygon closed.
A polygon is called convex if the line joining
  any two interior points of the polygon lies
  completely inside the polygon. A non-
  convex polygon is said to be concave.

             B                     B

       A
                               A
Another problem occurs when clipping a
closed polygon into several distinct smaller
polygons as shown:

   Clipping
   Window


                                      Concave
                                      Polygon
By convention, a polygon with vertices p1..pn
is said to be positively oriented if it produces
a anticlockwise direction. And if produces
clockwise it will be negative oriented.
                             C           D
  D              C
                         L       R
                                             E
             L       R
   E             B           B
                                     A
             A
SUTHERLAND-HODGMAN ALGORITHM
      Each edge of the polygon must be tested
against each edge of the clip rectangle; new
edges must be added, and existing edges must
be discarded, retained, or divided. Multiple
polygons may result from clipping a single
polygon. We need an organized way to deal
with all these cases.
Steps of Sutherland-Hodgman's polygon
clipping algorithm
 Polygons can be clipped against each edge
   of the window one at a time.
   Vertices which are kept after clipping
    against one window edge are saved for
    clipping against the remaining edges.
   Note that the number of vertices usually
    changes and will often increases.


                            The original polygon
                            and the clip
                            rectangle.
After clipped by the
right clip boundary.




After clipped by the
 right and bottom
clip boundaries.
After clipped by the
right, bottom, and
left clip boundaries.




After clipped by
all four
boundaries.
Four Cases of polygon clipping against one
Edge:
The clip boundary determines a visible and
Invisible region. The edges from vertex can
   be
one of four types:
 Case 1 : Wholly inside visible region - save
   endpoint
 Case 2 : Exit visible region - save the
   intersection
   Case 3 : Wholly outside visible region -
    save nothing
   Case 4 : Enter visible region - save
    intersection and endpoint
    V1
               V2                 V1
         V1’

                                 V2



         Out  in            in  in
         Save V1’,V2         Save V2
V2

      V1
V2 V1’      V1

 in  out        out  out
 Save V1’        Save none

More Related Content

PPTX
sutherland- Hodgeman Polygon clipping
PPTX
BRESENHAM’S LINE DRAWING ALGORITHM
PPTX
Hermit curves & beizer curves
PPT
Polygon filling
PPTX
Computer Graphics
PPTX
Attributes of output primitives( curve attributes & area fill attributes)
PDF
Design for manufacturing and assembly
PDF
Computer graphics notes
sutherland- Hodgeman Polygon clipping
BRESENHAM’S LINE DRAWING ALGORITHM
Hermit curves & beizer curves
Polygon filling
Computer Graphics
Attributes of output primitives( curve attributes & area fill attributes)
Design for manufacturing and assembly
Computer graphics notes

What's hot (20)

PPTX
Projection In Computer Graphics
PPTX
3 d display methods
PPT
Liang barsky Line Clipping Algorithm
PPTX
Frame buffer
PPTX
2D viewing & clipping
PDF
Unit 3
PPTX
2 d viewing computer graphics
PPTX
Output primitives in Computer Graphics
PPTX
Polygon filling algorithm
PPTX
The sutherland hodgeman polygon clipping algorithm
PPTX
3D transformation in computer graphics
PDF
Computer graphics curves and surfaces (1)
PPTX
Anti- aliasing computer graphics
PPTX
Window to Viewport Transformation in Computer Graphics with.pptx
PPTX
Clipping computer graphics
PPTX
clippiNG COMPUTER GRAPHICS A NEW ERA.pptx
PPTX
Clipping in Computer Graphics
PPTX
Graphics_3D viewing
PPTX
Computer graphics basic transformation
PPTX
Back face detection
Projection In Computer Graphics
3 d display methods
Liang barsky Line Clipping Algorithm
Frame buffer
2D viewing & clipping
Unit 3
2 d viewing computer graphics
Output primitives in Computer Graphics
Polygon filling algorithm
The sutherland hodgeman polygon clipping algorithm
3D transformation in computer graphics
Computer graphics curves and surfaces (1)
Anti- aliasing computer graphics
Window to Viewport Transformation in Computer Graphics with.pptx
Clipping computer graphics
clippiNG COMPUTER GRAPHICS A NEW ERA.pptx
Clipping in Computer Graphics
Graphics_3D viewing
Computer graphics basic transformation
Back face detection
Ad

Similar to Polygon clipping (20)

PPTX
jd.pptx
PPTX
ytsju.pptx
PPTX
hgfcftc.pptx
PPTX
kfty.pptx
PPTX
yyfty.pptx
PPTX
hgfcgf.pptx
PPTX
ytdty.pptx
PPTX
jfcft.pptx
PPTX
ufyty.pptx
PPTX
iuyf.pptx
PPTX
ohu.pptx
PPT
Clipping2
PPTX
ytt.pptx
PPTX
yutd65.pptx
PPTX
ibuib.pptx
PPTX
ydyu.pptx
PPT
Clipping in Computer Graphics
PPT
Polygon clipping
PDF
M.Sc_.-IV_ComputerGraphics_PolygonClipping_Bhupendra_K_Pandya.pdf
PPT
Polygon clipping
jd.pptx
ytsju.pptx
hgfcftc.pptx
kfty.pptx
yyfty.pptx
hgfcgf.pptx
ytdty.pptx
jfcft.pptx
ufyty.pptx
iuyf.pptx
ohu.pptx
Clipping2
ytt.pptx
yutd65.pptx
ibuib.pptx
ydyu.pptx
Clipping in Computer Graphics
Polygon clipping
M.Sc_.-IV_ComputerGraphics_PolygonClipping_Bhupendra_K_Pandya.pdf
Polygon clipping
Ad

More from Mohd Arif (20)

PPT
Bootp and dhcp
PPT
Arp and rarp
PPT
User datagram protocol
PPT
Project identification
PPT
Project evalaution techniques
PPT
Presentation
PPT
Pointers in c
PPT
Peer to-peer
PPT
Overview of current communications systems
PPT
Overall 23 11_2007_hdp
PPT
Objectives of budgeting
PPT
Network management
PPT
Networing basics
PPT
Loaders
PPT
Lists
PPT
Iris ngx next generation ip based switching platform
PPT
Ip sec and ssl
PPT
Ip security in i psec
PPT
Intro to comp. hardware
PPT
Heap sort
Bootp and dhcp
Arp and rarp
User datagram protocol
Project identification
Project evalaution techniques
Presentation
Pointers in c
Peer to-peer
Overview of current communications systems
Overall 23 11_2007_hdp
Objectives of budgeting
Network management
Networing basics
Loaders
Lists
Iris ngx next generation ip based switching platform
Ip sec and ssl
Ip security in i psec
Intro to comp. hardware
Heap sort

Polygon clipping

  • 1. Polygon Clipping Collection of connected lines is considered as Polygon. A polygon clipper takes as input the vertices of a polygon and returns one(or more) polygons. A closed Polygon when clipped C then we may get one or more open c d polygon or D lines. a A b B
  • 2. When we want clipping of a solid polygon area(closed polygon), then after clipping the resulting polygon should be closed. It requires that lines ab & cd be added to make it closed polygon. Hence it is difficult to find out which pieces of sections should be joined to make the clipped polygon closed.
  • 3. A polygon is called convex if the line joining any two interior points of the polygon lies completely inside the polygon. A non- convex polygon is said to be concave. B B A A
  • 4. Another problem occurs when clipping a closed polygon into several distinct smaller polygons as shown: Clipping Window Concave Polygon
  • 5. By convention, a polygon with vertices p1..pn is said to be positively oriented if it produces a anticlockwise direction. And if produces clockwise it will be negative oriented. C D D C L R E L R E B B A A
  • 6. SUTHERLAND-HODGMAN ALGORITHM Each edge of the polygon must be tested against each edge of the clip rectangle; new edges must be added, and existing edges must be discarded, retained, or divided. Multiple polygons may result from clipping a single polygon. We need an organized way to deal with all these cases.
  • 7. Steps of Sutherland-Hodgman's polygon clipping algorithm  Polygons can be clipped against each edge of the window one at a time.
  • 8. Vertices which are kept after clipping against one window edge are saved for clipping against the remaining edges.  Note that the number of vertices usually changes and will often increases. The original polygon and the clip rectangle.
  • 9. After clipped by the right clip boundary. After clipped by the right and bottom clip boundaries.
  • 10. After clipped by the right, bottom, and left clip boundaries. After clipped by all four boundaries.
  • 11. Four Cases of polygon clipping against one Edge: The clip boundary determines a visible and Invisible region. The edges from vertex can be one of four types:  Case 1 : Wholly inside visible region - save endpoint  Case 2 : Exit visible region - save the intersection
  • 12. Case 3 : Wholly outside visible region - save nothing  Case 4 : Enter visible region - save intersection and endpoint V1 V2 V1 V1’ V2 Out  in in  in Save V1’,V2 Save V2
  • 13. V2 V1 V2 V1’ V1 in  out out  out Save V1’ Save none