Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 14.

Slides:



Advertisements
Similar presentations
Polygon Scan Conversion – 11b
Advertisements

Computer Graphics Inf4/MSc 1 Computer Graphics Lecture 7 Scanline algorithm and polygon clipping Taku Komura.
Computer Graphics CLIPPING.
CS 352: Computer Graphics Chapter 7: The Rendering Pipeline.
Computer Graphics Viewing.
Viewing & Clipping In 2D. 2 of 44 Contents Windowing Concepts Clipping –Introduction –Brute Force –Cohen-Sutherland Clipping Algorithm Area Clipping –Sutherland-Hodgman.
CMPE 466 COMPUTER GRAPHICS Chapter 8 2D Viewing Instructor: D. Arifler Material based on - Computer Graphics with OpenGL ®, Fourth Edition by Donald Hearn,
Different types of Polygons Simple Convex Simple Concave Non-simple : self-intersecting With holes ConvexConcaveSelf-intersecting.
CPCS 391 Computer Graphics 1 Lecture 5: Polygon Filling
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Interpolation Clipping.
Implementation Dr. Amy Zhang. Reading 2  Hill, Chapters  Hill, Chapter 10.
Vertices and Fragments I CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
CMPE 466 COMPUTER GRAPHICS
CSCE 441: Computer Graphics Scan Conversion of Polygons
Graphics Programming: Polygon Filling
CS 454 Computer graphics Polygon Filling
Graphics Output Primitives Pixel Addressing and Fill Area Dr. M. Al-Mulhem Feb. 1, 2008.
CS 4731: Computer Graphics Lecture 22: Raster Graphics Part 3 Emmanuel Agu.
Rasterization Foley, Ch: 3. Pixels are represented as disjoint circles centered on uniform grid Each (x,y) of the grid has a pixel Y X (1,1) (1,2) (0,0)
1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Clipping.
Graphics Pipeline Rasterization CMSC 435/634. Drawing Terms Primitive – Basic shape, drawn directly – Compare to building from simpler shapes Rasterization.
Graphics Pipeline Clipping CMSC 435/634. Graphics Pipeline Object-order approach to rendering Sequence of operations – Vertex processing – Transforms.
TOPIC 4 PART III FILL AREA PRIMITIVES POLYGON FILL AREAS CGMB214: Introduction to Computer Graphics.
1 CSCE 441: Computer Graphics Scan Conversion of Polygons Jinxiang Chai.
Clipping Apart from clipping to the view volume, clipping is a basic operation in many other algorithms –Breaking space up into chunks –2D drawing and.
CGMB 314 Intro to Computer Graphics Fill Area Primitives.
1/24/20061 Fill-Area Algorithms and Functions. 1/24/20062 Learning Objectives OpenGL state variables Color and gray scale Color functions Point attributes.
Polygon Scan Conversion and Z-Buffering
Attributes A quality that is characteristic of someone or something.
Graphics Pipeline Rasterization CMSC 435/634. Drawing Terms Primitive – Basic shape, drawn directly – Compare to building from simpler shapes Rasterization.
3/4/04© University of Wisconsin, CS559 Spring 2004 Last Time Clipping Lines –Cohen-Sutherland: The use of outcodes and early reject/accept tests –Liang-Barsky:
Clipping: Clipping is a process of dividing an object into visible and invisible positions and displaying the visible portion and discarding the invisible.
Objectives Introduce basic implementation strategies Clipping Scan conversion.
CS 480/680 Computer Graphics Shading in OpenGL Dr. Frederick C Harris, Jr. Fall 2013.
College of Computer and Information Science, Northeastern UniversityMay 27, CS 4300 Computer Graphics Prof. Harriet Fell Fall 2012 Lecture 9 – September.
CSE Real Time Rendering Week 9. Post Geometry Shaders Courtesy: E. Angel and D. Shreiner – Interactive Computer Graphics 6E © Addison-Wesley 2012.
Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Appendix A.
EEL Introduction to Computer Graphics
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2013 Tamara Munzner Rasterization.
Attributes A quality that is characteristic of someone or something.
Computer Graphics Filling. Filling Polygons So we can figure out how to draw lines and circles How do we go about drawing polygons? We use an incremental.
Computer Graphics Lecture 20 Fasih ur Rehman. Last Class Clipping – What is clipping – Why we do clipping – How clipping is done.
Graphics Pipeline Rasterization CMSC 435/634. Drawing Terms Primitive – Basic shape, drawn directly – Compare to building from simpler shapes Rasterization.
Lecture 15: Raster Graphics and Scan Conversion
Graphics Graphics & Graphical Programming Lecture 23 - Viewing & Clipping.
1 CSCE 441: Computer Graphics Scan Conversion of Polygons Jinxiang Chai.
11-1 Space Figures and Cross Sections Objectives To recognize polyhedra and their parts To visualize cross sections of space figures.
Vocabulary Word: Supplementary Angles Definition: Two angles whose sum is 180°.
Rasterization Overview Raster Display Device. Scan Conversion / Rasterization: converting vector graphics into raster graphics (determining pixels in.
Computer Graphics CC416 Week 14 Filling Algorithms.
Computer Graphics Lecture 08 Taqdees A. Siddiqi Computer Graphics Filled Area Primitives I Lecture 08 Taqdees A. Siddiqi
Lecture 9 From Vertices to Fragments. Objectives Introduce basic implementation strategies Clipping Rasterization hidden-surface removal.
CS552: Computer Graphics Lecture 16: Polygon Filling.
Computer Graphics Filling.
Introduction to Polygons
Computer Graphics CC416 Week 13 Clipping.
Polygons.
(c) 2002 University of Wisconsin, CS559
Computer Graphics Filled Area Primitives II Lecture 09 Taqdees A
Fill Area Algorithms Jan
Agenda Polygon Terminology Types of polygons Inside Test
Agenda Polygon Terminology Types of polygons Inside Test
Lecture 13 Clipping & Scan Conversion
Prof. Harriet Fell Fall 2011 Lecture 9 – September 26, 2011
(c) 2002 University of Wisconsin, CS559
Rasterizing Polygons 2 Lecture 35 Mon, Nov 26, 2007.
Rasterizing Polygons Lecture 29 Wed, Dec 7, 2005.
Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 19.
Where We Stand At this point we know how to: Next thing:
Presentation transcript:

Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 14

Figure 14.1: (a) A clipping rectangle R and four straight line segments with their parts clipped to R colored (b) Nine regions of the plane by outcode.

Figure 14.2: Cohen-Sutherland, called on segment p 1 p 2, recursively calls itself on p 2 q 1, q 1 q 2 and q 2 q 3, successively.

Figure 14.3: Clipping a semi-infinite segment to a rectangle.

Figure 14.4: Clipping a line segment to an axis-aligned box.

Figure 14.5: Cohen-Sutherland intersection computation.

Figure 14.6: A pipeline of clippers.

Figure 14.7: The left clipper in action: input = {v 0, v 1, v 2, v 3 }, output = {v 0, v 1, v 2, w, w’}.

Figure 14.8: Output of a pair of successive vertices (equivalently, edge) entering the left clipper. Note both in-out and out-in dispositions have a special case, labeled (ii), where the vertex on the inside actually lies on L.

Figure 14.9: Applying the clipping rules.

Figure 14.10: The right clipper consumes the first two vertices v 1 and v 2 entering into it from the left clipper to output w’’ and v 2.

Figure 14.11: An m x n raster of pixels and a rasterized straight line segment.

Figure 14.12: Screenshot of DDA.cpp.

Figure 14.13: The larger circles are pixel centers. (a) Pixel (i, j) shown filled blue has just been chosen, the two candidate pixels for the next step are filled orange (b) Diagram for Example 14.3.

Figure 14.14: Discrim- inating the position of a point with respect to a segment: S is bold, while the straight line through it is thin.

Figure 14.15: Intersections of R with the boundary of P are labeled with their respective ranks.

Figure 14.16: Testing parity: the points p 3 and p 4 require handling a singularity.

Figure 14.17: Applying the parity test: the integer label beneath a segment of R indicates the number of intersections of R with the boundary of P prior to reaching that segment. The reason for the change from 5 to 7 after p 6 and from 9 to 11 after edge w’ is explained in the text. The edges w and w’ are not labeled because they lie on the boundary.

Figure 14.18: The scan line as a ray with parities along segments indicated. Pixels fill the polygon according to the parity test: pixels in the polygon are drawn solid, others are hollow.

Figure 14.19: Abutting polygons.

Figure 14.20: The non-horizontal edges of P are labeled left or right, while the horizontal ones top or bottom. P owns the part of the boundary it shares with Q; P does not own the part of the boundary it shares with Q’.

Figure 14.21: Problems with Version 1.

Figure 14.22: Counting intersections according to Version 2: shown are eight scan lines, their intersections with the polygon boundary and the number of times each intersection point appears in the sorted list for that scan line, according to statements 1 and 2 of algorithm Version 2. Polygon vertices and intersection points are not named to avoid clutter.

Figure 14.23: Edge coherence.

Figure 14.24: The AEL values for scan lines 0, 4 and 5 for a polygon P in a 19 x 11 raster. Pixels are drawn as hollow circles only for these three scan lines.

Figure 14.25: Edge table for the polygon P of Figure

Figure 14.26: (a) Typ- ical dispositions of a left and right edge with respect to a run of pixels (b) The one exceptional case where a left and a right edge meet at a common lower endpoint.

Figure 14.27: Flood-fill: (a) Initially (b) Fill pixels 4-adjacent to p (c) Fill pixels 4-adjacent to the ones filled in the previous step. The starred pixel of (b) is examined by both its south and west neighbors at this step.

Figure 14.28: Flood-fill fails on the polygon Q whose boundary is drawn.