Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
879 views
13 pages
Computer Graphics - Chapter 3 Solid Area Polygon Filling
Computer Graphics _ Chapter 3 Solid Area / Polygon Filling. Inside-Out Technique Polygons, Odd-Even Methods, Winding Number Method, Boundary fill, Flood fill
Uploaded by
Zeeshan Bhatti
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save Computer Graphics_Chapter 3 Solid Area Polygon Fil... For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
879 views
13 pages
Computer Graphics - Chapter 3 Solid Area Polygon Filling
Computer Graphics _ Chapter 3 Solid Area / Polygon Filling. Inside-Out Technique Polygons, Odd-Even Methods, Winding Number Method, Boundary fill, Flood fill
Uploaded by
Zeeshan Bhatti
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save Computer Graphics_Chapter 3 Solid Area Polygon Fil... For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 13
Search
Fullscreen
COMPUTER GRAPHICS SOLID AREA (POLYGON) FILLING Institute of Information and Communication Technology University of Sindh, Jamshoro BY:OR.ZEESHANGHATTI Dr. Zeeshan Bhatti on PIV POLYGON ‘A polygon is a chain of connected line segments Itis specified by points called Vertices (aka nodes), usually denoted by P,, P,, P.,......P, ‘The first vertex is called the initial or starting point and the last vertex is called the final or terminal point. AsualPOLYGON Representation: Polygon = Vo, V;, Vo, -- Va V.=(X,y,) - vertex E=(v,,v+1) - edge V2 vertex E,=(Vn.Vo) E EB Vo ne, E. V3, edge Vi Ve z FILL POLYGON Question: How do we know if a given point is inside or outside a polygon?INSIDE — OUTSIDE TEST To Scan Convert a polygon means to paint the interior of the polygon shape. To fill the polygon shape with solid color. How to differentiate between the interior and the exterior of a polygon. Two techniques |. Odd - Even Method 2. Winding Number Method oN ODD -EVENMI +: This is a very simple method. The steps of the method are as follows: Step 1: Select an outside point Step 2: Draw a horizontal straight line from the outside point to the point in question. Step 3: Count the number of intersections of the straight line with the polygon boundaries. Step 4: if the count is odd, the point in question is an inside point, otherwise it is an outside point.| WINDING NUMBER elt MET! number of times the polygon winds around the point P. The point is outside only when this "winding number" wn = 0; otherwise, the point is inside. “Add 1 (+1) to the winding number every time we intersect the edge that cross lines from right to left and subtract 1 (-1) form the winding number, every time we intersect cross lines from left to right. /\ «If the winding number is not equal to zero, ¢ the point P is within the polygon (inside), otherwise outside the polygon. Winding Nunber=0-1+1¢1=1=> Point Pis inthe interior1. 2. WINDING NUMBER METHOD - : ALGORITHM torrsacinae The method of the non-zero winding NUiwwer aie wie Comes the number of times edges wind around a point P in a counter- clockwise direction. Initialize the winding number to zero. Draw a line from P to the exterior of the polygon without passing through a vertex. Add 1 to the winding number for every edge that crosses the line from P in one direction (clockwise or counter- clockwise) and subtract 1 from the winding number for every crossing edge in the opposite direction. If the winding number is not equal to zero, the point P is within the polygon.SCAN CONVERSION - DOI VGON Fil | Problem: Given a closed 2D polygon, fill its interior with a specified color, on a graphics display ai ®> @ Assumption: Polygon is simple, i.e. no self intersections, and simply connected, i.e. without holes Solutions: +Flood fill «Scan Conversion Boundary fill * Suppose the boundary is uniquely defined pixel quality. * A boundary fill algorithm starts from an interior point and expands until we reach the boundary. * The prole is to make sure that we really cover all of the interior!Boundary fill + Use stencils to test for additional interior points. + 4-connected stencil + 8-connected stencil Boundary-Fill Algorithm eo Figure 3-41 , Interior fill of an elliptical arc CY Fill methods applied toa 4-connected area (a) and to an S-connected area (b). Open circles represent pixels to be tested from the current test position, shown as a solid color 4 Figure 3-42 Example color boundaries for a boundary-fill procedureStart Position (a tb) Figure 3-44 The area defined within the color boundary (a) is only partially filled in (b) using a 4-connected boundary-fill algorithm. Boundary Fill Suppose that the edges of the polygon has already been colored. Suppose that the interior of the polygon is to be colored a different color from the edge. Suppose we start with a pixel inside the polygon, then we color that pixel and all surrounding pixels until we meet a pixel that is already colored. void boundaryFill(int x, int y, int fillColor, int borderColor) { int interiorColor; getPixel(xy,interiorColor); if ((interiorColor!=borderColor)8&.&(interiorColor!=fillColor)) { setPixel(x,y,fillColor); boundaryFill(x+1,y,fillColor,borderColor); boundaryFill(x-1,y,fillColor, borderColor); boundaryFill(x,y+1 fllColor,borderColor); boundaryFill(x,y-1 fillColor, borderColor);FLOOD FILL ALGORITHM Let P be a polygon with n vertices, vo .. v4 *Denote v,=V9 Let c be a color to paint P Let p=(x,y) be a point in P FLOOD FILL ALGORITHM FloodFill(P,x,y,¢) if (OnBoundary(x,y,P) or Colored (x,y,c)) then return; else begin PlotPixel(x,y.c); FloodFill(P,x+1,y,c); FloodFill(P,x,y+1,c); FloodFill(P,x,y-1,¢); FloodFill(P,x-1,y,c) end; Slow algorithm due to recursion, needs initial pointSCAN CONVERSION — RASIC Al GORITHM +Let P be a polygon with n vertices, vg .. V,., *Denote v,=Vo eLet c be a color to paint P ScanConvert (P,c) Forj:=0 to ScreenYMax do 1 := points of intersection of edges from P with line y=j; Sort J in increasing x order and fill with color c alternating segments; end; Question: How do we find the intersecting edges? | FLOOD FILL VS. SCAN CONVERSION Flood Fill Scan Conversion “Very simple. *More complex *Requires a seed point *No seed point is required *Requires large stack size *Requires small stack size *Common in paint *Used in image rendering packagesSCAN CONVERSION — FILL PAI VGON SCAN CONVERSION -— FILL POLYGON Intersections at pixel coordinates A S ! B E H © D F Rule: In the odd/even count, we count y,,,, vertices of an edge, but not Ynax vertices Vertex B is counted once because y,,, of (A,B) Vertex E is not counted because y,,,, Of both (D, E) and (E, F) Vertex H is counted twice because y,,;, of both (G, H) and (H, I)FILL POLYGON — OPTIMIZED ALGORITHM Uses a list of “active” edges A (edges currently intersecting the scan line) ScanConvert(P.c) Sort all edges E={E} in increasing MinY(E, ) order. A=D; For k :=0 to ScreenYMax do Foreach E,
You might also like
FYP Project Presentation Template
PDF
78% (37)
FYP Project Presentation Template
14 pages
UNIT4
PDF
No ratings yet
UNIT4
7 pages
CG PPT 2
PDF
No ratings yet
CG PPT 2
82 pages
CG Unit - 2
PDF
No ratings yet
CG Unit - 2
80 pages
CG Unit 2 Notes
PDF
No ratings yet
CG Unit 2 Notes
23 pages
05.scan Conversion3
PDF
No ratings yet
05.scan Conversion3
34 pages
02.polygon, Windowing and Clipping
PDF
No ratings yet
02.polygon, Windowing and Clipping
18 pages
CG Unit 4 Polygon
PDF
No ratings yet
CG Unit 4 Polygon
16 pages
Polygon Filling Algorithm
PDF
No ratings yet
Polygon Filling Algorithm
6 pages
Computer Graphics Polygon
PDF
No ratings yet
Computer Graphics Polygon
86 pages
UNIT - II Part 1
PDF
No ratings yet
UNIT - II Part 1
93 pages
Week-5 Solid - Fill - Algo
PDF
No ratings yet
Week-5 Solid - Fill - Algo
23 pages
CG 8
PDF
No ratings yet
CG 8
83 pages
Computer Graphics Chapter 4
PDF
No ratings yet
Computer Graphics Chapter 4
15 pages
CG - Unit Ii - Polygon, Windowing and Clipping
PDF
No ratings yet
CG - Unit Ii - Polygon, Windowing and Clipping
93 pages
CG Module4
PDF
No ratings yet
CG Module4
16 pages
Introduction To Polygons: Edges
PDF
No ratings yet
Introduction To Polygons: Edges
33 pages
Area Fill Algorithms For Various Graphics Primitives: Amity University, Haryana
PDF
No ratings yet
Area Fill Algorithms For Various Graphics Primitives: Amity University, Haryana
53 pages
Unit II - Polygon
PDF
No ratings yet
Unit II - Polygon
23 pages
Chapter IV
PDF
No ratings yet
Chapter IV
8 pages
Polygaon
PDF
No ratings yet
Polygaon
22 pages
Computer Graphics Polygon Filling
PDF
No ratings yet
Computer Graphics Polygon Filling
122 pages
Computer Graphics Unit 2
PDF
No ratings yet
Computer Graphics Unit 2
21 pages
Teaching Math
PDF
No ratings yet
Teaching Math
54 pages
Screenshot 2024-06-04 at 8.20.18 PM
PDF
No ratings yet
Screenshot 2024-06-04 at 8.20.18 PM
73 pages
Area Filling
PDF
No ratings yet
Area Filling
5 pages
Cgrpolygonsversion 1 200729063649
PDF
No ratings yet
Cgrpolygonsversion 1 200729063649
20 pages
Chapter 4
PDF
No ratings yet
Chapter 4
8 pages
Unit 1.2.5introduction To Polygon Filling
PDF
No ratings yet
Unit 1.2.5introduction To Polygon Filling
18 pages
A Review Polygon Filling Algorithms Using Inside-Outside Test PDF
PDF
No ratings yet
A Review Polygon Filling Algorithms Using Inside-Outside Test PDF
3 pages
Different Types of Polygons - Simple Convex - Simple Concave - Non-Simple: Self-Intersecting - With Holes
PDF
No ratings yet
Different Types of Polygons - Simple Convex - Simple Concave - Non-Simple: Self-Intersecting - With Holes
38 pages
Module 2 CG & IP
PDF
No ratings yet
Module 2 CG & IP
32 pages
Polygon & Clipping Algorithm: Unit: Ii
PDF
No ratings yet
Polygon & Clipping Algorithm: Unit: Ii
82 pages
Computer Graphics Cs 602 Lecture 08
PDF
No ratings yet
Computer Graphics Cs 602 Lecture 08
24 pages
Fill Algorithms: Soon Tee Teoh CS 116B
PDF
No ratings yet
Fill Algorithms: Soon Tee Teoh CS 116B
11 pages
Notes2 CG
PDF
No ratings yet
Notes2 CG
15 pages
Filled Area Primitives
PDF
No ratings yet
Filled Area Primitives
7 pages
What Is Polygon ?...........
PDF
No ratings yet
What Is Polygon ?...........
28 pages
CG U2 Technical
PDF
No ratings yet
CG U2 Technical
55 pages
Computer Graphics U2
PDF
No ratings yet
Computer Graphics U2
3 pages
Polygon Filling
PDF
No ratings yet
Polygon Filling
48 pages
Unit 2
PDF
No ratings yet
Unit 2
68 pages
Polyfill 2
PDF
No ratings yet
Polyfill 2
11 pages
An Efficient Fence Fill Algorithm Using Inside-Outside Test
PDF
No ratings yet
An Efficient Fence Fill Algorithm Using Inside-Outside Test
5 pages
Week 4 Filled Area Primitives
PDF
No ratings yet
Week 4 Filled Area Primitives
20 pages
Computer Notes Filled Area Primitives I
PDF
No ratings yet
Computer Notes Filled Area Primitives I
24 pages
Computer Graphics
PDF
No ratings yet
Computer Graphics
9 pages
Unit 1 Filled Area Primitives
PDF
No ratings yet
Unit 1 Filled Area Primitives
6 pages
L-05 Polygons
PDF
No ratings yet
L-05 Polygons
51 pages
Interior Pixels Along A Scan Line Passing Through A Polygon Area
PDF
No ratings yet
Interior Pixels Along A Scan Line Passing Through A Polygon Area
32 pages
Polygon Filling
PDF
No ratings yet
Polygon Filling
77 pages
CGR Polygons Version-1
PDF
No ratings yet
CGR Polygons Version-1
22 pages
Unit 4
PDF
No ratings yet
Unit 4
43 pages
CG Ia 2
PDF
No ratings yet
CG Ia 2
12 pages
Polygon Clipping and Filling
PDF
No ratings yet
Polygon Clipping and Filling
7 pages
Polygon Filling
PDF
No ratings yet
Polygon Filling
63 pages
CG Study Material Graphics-40-65
PDF
No ratings yet
CG Study Material Graphics-40-65
26 pages
CSE-457 Computer Graphics Polygon Filling
PDF
No ratings yet
CSE-457 Computer Graphics Polygon Filling
63 pages
Computer Graphics Polygon Filling
PDF
No ratings yet
Computer Graphics Polygon Filling
63 pages
IT Project Management Chapter 6 Project Implementation
PDF
No ratings yet
IT Project Management Chapter 6 Project Implementation
25 pages
Computer Graphics - Lab Project 4: 2D Transformation
PDF
100% (1)
Computer Graphics - Lab Project 4: 2D Transformation
4 pages
BS Information Technology (Morning) Final Year Projects Proposal Final Approval List.
PDF
100% (2)
BS Information Technology (Morning) Final Year Projects Proposal Final Approval List.
2 pages
BS Software Engineering (Evening) Final Year Projects Proposal Final List.
PDF
No ratings yet
BS Software Engineering (Evening) Final Year Projects Proposal Final List.
1 page
BS Telecommunication Final Year Projects Proposal Final Approval List.
PDF
0% (1)
BS Telecommunication Final Year Projects Proposal Final Approval List.
1 page
Artificial Intelligence: Chapter 4 Introduction To Knowledge Base Systems
PDF
No ratings yet
Artificial Intelligence: Chapter 4 Introduction To Knowledge Base Systems
20 pages
IT Project Management: Chapter 4 Resource Plan and Cost Estimation
PDF
No ratings yet
IT Project Management: Chapter 4 Resource Plan and Cost Estimation
44 pages
Final Project Poster Samples Sample 1
PDF
No ratings yet
Final Project Poster Samples Sample 1
4 pages
BSIT (Evening) Final Year Projects Proposal Evaluation Report
PDF
No ratings yet
BSIT (Evening) Final Year Projects Proposal Evaluation Report
3 pages
Artificial Intelligence: Chapter 5 - Machine Learning
PDF
No ratings yet
Artificial Intelligence: Chapter 5 - Machine Learning
30 pages
Artificial Intelligence Chapter 3: Problem Solving and Searching
PDF
100% (1)
Artificial Intelligence Chapter 3: Problem Solving and Searching
94 pages
IICT Final Year Project Result 2K12 Batch
PDF
No ratings yet
IICT Final Year Project Result 2K12 Batch
13 pages
BSIT (Morning) Final Year Projects Proposal Evaluation Report
PDF
No ratings yet
BSIT (Morning) Final Year Projects Proposal Evaluation Report
3 pages
Computer Graphics - Lab Handout 1 - CPP Graphics
PDF
No ratings yet
Computer Graphics - Lab Handout 1 - CPP Graphics
7 pages
Artificial Intelligence - Chapter 2 Agents and Rational Agents Part II
PDF
No ratings yet
Artificial Intelligence - Chapter 2 Agents and Rational Agents Part II
32 pages
Artificial Intelligence: Chapter 2 Week 2 and 3
PDF
100% (1)
Artificial Intelligence: Chapter 2 Week 2 and 3
43 pages
Poster Clipboards / Hangers Samples Sample 1
PDF
No ratings yet
Poster Clipboards / Hangers Samples Sample 1
4 pages
Chapter 6 - Computer Animation Types and Techniques
PDF
100% (1)
Chapter 6 - Computer Animation Types and Techniques
93 pages
Module 3 - Lecture 3 - Installing Domain Controllers
PDF
No ratings yet
Module 3 - Lecture 3 - Installing Domain Controllers
24 pages
Lecture 1 - Computer Graphics - Chapter 1 Introduction
PDF
No ratings yet
Lecture 1 - Computer Graphics - Chapter 1 Introduction
57 pages
Computer Graphics - Chapter 2
PDF
No ratings yet
Computer Graphics - Chapter 2
51 pages
Artificial Intelligence: Lecture 1 - Chapter 1
PDF
100% (1)
Artificial Intelligence: Lecture 1 - Chapter 1
54 pages