Lecture 15: Raster Graphics and Scan Conversion

Slides:



Advertisements
Similar presentations
Polygon Scan Conversion – 11b
Advertisements

Computer Graphics- SCC 342
Computer Graphics 4: Bresenham Line Drawing Algorithm, Circle Drawing & Polygon Filling By:Kanwarjeet Singh.
CMPE 466 COMPUTER GRAPHICS
CS 450: COMPUTER GRAPHICS FILLING POLYGONS SPRING 2015 DR. MICHAEL J. REALE.
Polygon Rasterization
Computer Graphics Scan Conversion Polygon Faculty of Physical and Basic Education Computer Science Dep Lecturer: Azhee W. MD.
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
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
Scan Conversion II Revision 1.4 2/13/07 Copyright 2006, Dr. Zachary Wartell, UNCC, All Rights Reserved.
CS 454 Computer graphics Polygon Filling
Graphics Output Primitives Pixel Addressing and Fill Area Dr. M. Al-Mulhem Feb. 1, 2008.
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)
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.
March Shape Drawing Algorithms Shmuel Wimer Bar Ilan Univ., Engineering Faculty.
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
Basics of Rendering Pipeline Based Rendering –Objects in the scene are rendered in a sequence of steps that form the Rendering Pipeline. Ray-Tracing –A.
CS 450: Computer Graphics PIXEL AdDRESSING AND OBJECT GEOMETRY
Informationsteknologi Monday, November 26, 2007Computer Graphics - Class 121 Today’s class Drawing lines Bresenham’s algorithm Compositing Polygon filling.
Triangle Scan Conversion. 2 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Rasterization Rasterization (scan conversion) –Determine which.
Part 6: Graphics Output Primitives (4) 1.  Another useful construct,besides points, straight line segments, and curves for describing components of a.
Graphics Pipeline Rasterization CMSC 435/634. Drawing Terms Primitive – Basic shape, drawn directly – Compare to building from simpler shapes Rasterization.
CS 480/680 Computer Graphics Implementation III Dr. Frederick C Harris, Jr. Fall 2011.
1 Filling Graphical Shapes. 2 We know how to draw outlines Can we just fill the “inside”? …but how do we know the difference between the inside and outside?
Graphics Graphics Korea University cgvr.korea.ac.kr 1 2D Viewing 고려대학교 컴퓨터 그래픽스 연구실.
2D Output Primitives Points Lines Circles Ellipses Other curves Filling areas Text Patterns Polymarkers.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
CAP4730: Computational Structures in Computer Graphics
Fall 2004CS-321 Dr. Mark L. Hornick 1 Final Exam Monday Nov 13, 2-4pm CC-43 Bring Calculator – no laptops Note sheet Complete FAST entries before exam.
Hidden Surface Removal
Drawing Triangles CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
In the name of God Computer Graphics. Today Introduction Sampling Graphic Output Primitives 1.Line 2.Circle 3.Curve 4.polygon.
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.
2D Output Primitives Points Lines Circles Ellipses Other curves Filling areas Text Patterns Polymarkers.
1 CSCE 441: Computer Graphics Scan Conversion of Polygons Jinxiang Chai.
Lecture 13: Raster Graphics and Scan Conversion
OUTPUT PRIMITIVES A.Aruna/Faculty of Information technology/SNSCE13/19/2016.
Rasterization Overview Raster Display Device. Scan Conversion / Rasterization: converting vector graphics into raster graphics (determining pixels in.
Computer Graphics CC416 Week 14 Filling Algorithms.
Visible-Surface Detection Methods. To identify those parts of a scene that are visible from a chosen viewing position. Surfaces which are obscured by.
Computer Graphics Lecture 08 Taqdees A. Siddiqi Computer Graphics Filled Area Primitives I Lecture 08 Taqdees A. Siddiqi
Computer Graphics CC416 Lecture 04: Bresenham Line Algorithm & Mid-point circle algorithm Dr. Manal Helal – Fall 2014.
Lecture 30: Visible Surface Detection
OUTPUT PRIMITIVES CEng 477 Computer Graphics METU, 2004.
CS552: Computer Graphics Lecture 16: Polygon Filling.
Lecture 5 Basic geometric objects
Computer Graphics Filling.
Introduction to Polygons
Polygons.
(c) 2002 University of Wisconsin, CS559
Computer Graphics Filled Area Primitives II Lecture 09 Taqdees A
Fill Area Algorithms Jan
Midterm Review Computer Graphics Hardware Point and Line Drawing
Polygon Filling Algorithms
Agenda Polygon Terminology Types of polygons Inside Test
Prepared by Narendra V G CSE MIT
Agenda Polygon Terminology Types of polygons Inside Test
(c) 2002 University of Wisconsin, CS559
Chapter 3 Graphics Output Primitives
Primitive Drawing Algorithm
Rasterizing Polygons Lecture 29 Wed, Dec 7, 2005.
Primitive Drawing Algorithm
Where We Stand At this point we know how to: Next thing:
Presentation transcript:

Lecture 15: Raster Graphics and Scan Conversion CS552: Computer Graphics Lecture 15: Raster Graphics and Scan Conversion

Recap Issues related to scan converting a line Generalized line drawing algorithm Mid point circle drawing algorithm

Objective After completing this lecture students will be able to Derive mathematical expression for drawing am ellipse Write programs to implement ellipse drawing algorithm Explain polygon filling algorithms

Ellipse 𝑥 2 𝑎 2 + 𝑦 2 𝑏 2 =1 𝐹 𝑥,𝑦 = 𝑏 2 𝑥 2 + 𝑎 2 𝑦 2 − 𝑎 2 𝑏 2 =0 𝑥 2 𝑎 2 + 𝑦 2 𝑏 2 =1 𝐹 𝑥,𝑦 = 𝑏 2 𝑥 2 + 𝑎 2 𝑦 2 − 𝑎 2 𝑏 2 =0 Minor axis (0,0) Major axis

Four way symmetry in ellipse

Filling rectangles The task of filling primitives can be broken into two parts: the decision of which pixels to fill shape of the primitive with what value to fill them.

Filling rectangles for (y=YMIN; y<YMAX; y++) // by scan line { for (x=XMIN; x<XMAX; x++) // by pixel in span WritePixel(x,y,color); }

Polygons A polygon is a many-sided planar figure composed of vertices and edges. A polygon is bounded (finite area) and closed (includes boundary). Vertices are represented by points (x,y). Edges are represented as line segments which connect two points, (x1,y1) and (x2,y2). P = { (xi , yi ) } i=1,n E3 (x3,y3) E2 (x2,y2) E1 (x1,y1)

Polygons: Complex vs Simple A simple polygon – edges only intersect a vertices, no coincident vertices A complex polygon – edges intersect and/or coincident vertices A B C E F G H C E D A B B A C A B,E C D F

Simple Polygons: Convex and Concave Convex Polygon - For any two points P1, P2 inside the polygon, all points on the line segment which connects P1 and P2 are inside the polygon. All points P = uP1 + (1-u)P2, u in [0,1] are inside the polygon provided that P1 and P2 are inside the polygon. Concave Polygon - A polygon which is not convex.

Inside-Outside Tests Identifying the interior of a simple object Non-zero winding number Rule Odd-Even Rule

Filled- Area Primitives A standard output primitive in general graphics packages is a solid-color or patterned polygon area. The scan-line approach Determine the overlap intervals for scan lines that cross the area. Typically used in general graphics packages to fill polygons, circles, ellipses Filling approaches Start from a given interior position and paint outward from this point until we encounter the specified boundary conditions. Useful with more complex boundaries and in interactive painting systems.

Scan-Line Polygon-Fill For each scan line crossing a polygon Locate the intersection points of the scan line with the polygon edges. These intersection points are then sorted from left to right, the corresponding frame-buffer positions between each intersection pair are set to the specified fill color.

Example

Issues

Issues

Adjust end point calculation

Filled- Area Primitives (cont.) Scan-conversion algorithms typically take advantage of various coherence properties of a scene Coherence is simply that the properties of one part of a scene are related in some way to other parts of the scene so that the relationship can be used to reduce processing. Coherence methods often involve incremental calculations applied along a single scan line between successive scan lines.

Coherence Example Slope of the edge Change in y coordinates between the two scan lines is ? Given the current x-intercept, the next x-intercept coordinate =

Different situations while scanning Intersection point change by the amount of the slope of the line Edges may start / end Tracking of intersection points is the key Vertices Edges Active Edge Table (AET)

Thank you Next Lecture: Scan Line Filling Algorithm