Scan Conversion. Last step in the graphics pipeline Efficiency is a central issue Common primitives – Lines (done last class) – Polygons (fill polygons,

Slides:



Advertisements
Similar presentations
Polygon Scan Conversion – 11b
Advertisements

SI23 Introduction to Computer Graphics
Okay, you have learned … OpenGL drawing Viewport and World Window setup main() { glViewport(0,0,300,200); glMatrixMode(GL_PROJECTION); glLoadIndentity();
Project-Impact/CSE/IITB/93 CG/Mod-2/SC/1 Basic Raster Graphics "Trifles make perfection, but perfection is no trifle" Michael Angelo ++ Topics Scan conversion.
Scan Conversion A. Samal. Scan Conversion Last step in the graphics pipeline Efficiency is a central issue Common primitives – Lines – Polygons – Circles.
Line Drawing Algorithms. Rasterization-Process of determining which pixels give the best approximation to a desired line on the screen. Scan Conversion-Digitizing.
OUTPUT PRIMITIVES Screen vs. World coordinate systems ● Objects positions are specified in a Cartesian coordinate system called World Coordinate.
CS 450: COMPUTER GRAPHICS FILLING POLYGONS SPRING 2015 DR. MICHAEL J. REALE.
Okay, you have learned … OpenGL drawing Viewport and World Window setup main() { glViewport(0,0,300,200); glMatrixMode(GL_PROJECTION); glLoadIndentity();
Polygon Rasterization
CP411 polygon Lecture 6 1. Scan conversion algorithm for circle 2. Draw polygons 3. Antialiasing.
College of Computer and Information Science, Northeastern UniversityApril 17, CS U540 Computer Graphics Prof. Harriet Fell Spring 2009 Lecture 9.
Graphics Graphics Korea University cgvr.korea.ac.kr 1 Hidden Surface Removal 고려대학교 컴퓨터 그래픽스 연구실.
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.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Scan Conversion Week 6, Mon 6 Oct 2003 recap: Bresenham line algorithm scan.
CS 248 Assignment 2 Polygon Scan Converter CS248 Presented by Abe Davis Stanford University October 17, 2008.
Scan Conversion Week 6, Wed 8 Oct 2003
CS 248 Assignment 2 Polygon Scan Conversion CS248 Presented by Zak Middleton Stanford University October 18, 2002.
1 CSCE 441: Computer Graphics Scan Conversion of Polygons Jinxiang Chai.
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
Computer Graphics Panos Trahanias ΗΥ358 Spring 2009.
Graphics Pipeline Rasterization CMSC 435/634. Drawing Terms Primitive – Basic shape, drawn directly – Compare to building from simpler shapes Rasterization.
Informationsteknologi Monday, November 26, 2007Computer Graphics - Class 121 Today’s class Drawing lines Bresenham’s algorithm Compositing Polygon filling.
College of Computer and Information Science, Northeastern UniversityOctober 12, CS G140 Graduate Computer Graphics Prof. Harriet Fell Spring 2006.
CS 480/680 Computer Graphics Implementation III Dr. Frederick C Harris, Jr. Fall 2011.
College of Computer and Information Science, Northeastern UniversityMay 27, CS 4300 Computer Graphics Prof. Harriet Fell Fall 2012 Lecture 9 – September.
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.
Hidden Surface Removal
Copyright  1999 by James H. Money. All rights reserved. Except as permitted under United States Copyright Act of 1976, no part of this publication may.
Introduction to Computer Graphics CS 445 / 645 Lecture 9 Chapter 4: Rasterization L. McMillan MIT notes (Fall ’98)
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2013 Tamara Munzner Rasterization.
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.
Graphics Pipeline Rasterization CMSC 435/634. Drawing Terms Primitive – Basic shape, drawn directly – Compare to building from simpler shapes Rasterization.
Rendering.
Lecture 15: Raster Graphics and Scan Conversion
1 CSCE 441: Computer Graphics Scan Conversion of Polygons Jinxiang Chai.
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
Computer Graphics I, Fall 2010 Scan conversion algorithms.
OUTPUT PRIMITIVES CEng 477 Computer Graphics METU, 2004.
CS552: Computer Graphics Lecture 16: Polygon Filling.
Computer Graphics Filling.
Introduction to Polygons
CS G140 Graduate Computer Graphics
Computer Graphics Shading in OpenGL
Basic Raster Graphics Algorithms for Drawing 2D Primitives
Computer Graphics Filled Area Primitives II Lecture 09 Taqdees A
Implementation III.
Prof. Harriet Fell Spring 2007 Lecture 9 – January 29, 2007
Prepared by Narendra V G CSE MIT
Lecture 13 Clipping & Scan Conversion
Prof. Harriet Fell Fall 2011 Lecture 9 – September 26, 2011
Introduction to Meshes
(c) 2002 University of Wisconsin, CS559
Rasterizing Polygons 2 Lecture 35 Mon, Nov 26, 2007.
Primitive Drawing Algorithm
Rasterizing Polygons Lecture 29 Wed, Dec 7, 2005.
Basic Raster Graphics Algorithms for Drawing 2D Primitives
Chapter 14 Shading Models.
Primitive Drawing Algorithm
Type to enter a caption. Computer Graphics Week 6 Lecture 1.
Polygons.
Introduction to Meshes
Clipping Polygons Lecture 31 Fri, Nov 9, 2007.
Presentation transcript:

Scan Conversion

Last step in the graphics pipeline Efficiency is a central issue Common primitives – Lines (done last class) – Polygons (fill polygons, today) – Circles Hardware implementations preferable

Filling Polygons: Scan Line Algorithm

Filling Polygons: Special Cases Edge Table (ET) Entry

Scan Line Polygon Fill Algorithm A B C D E F / / /4 -5/2             Scan Line ABBC FA CD EFDE

AET AET at scanline y=8 AET at Scanline y =9 ET Record format : (Ymax, Xmin, 1/m) AET Records format: (Ymax, Xcurrent, 1/m)

Scan Line Polygon Fill: The Algorithm Set y to smallest y coordinate that has an entry in ET Initialize the active edge table (AET) to empty Repeat until the ET and AET are both empty: – Move from ET bucket at y to AET those edges whose ymin = y. (entering edges) – Remove from AET those edges for which y = ymax. – Sort AET on x – Fill in desired pixels on scan line using even-odd parity from AET – Increment y by one (next scan line) – For each edge in the AET, update x by adding  x/  y

What color to fill? Recall Shading in OpenGL: Smooth Shading Requested by: glShadeModel(GL_SMOOTH); Lighting calculations will be done at each vertex using the material properties, and the vectors v and l calculated for that vertex. Bilinear interpolation is used to determine color values in the interior of the polygon.

Bilinear Interpolation Cp = ? Cq= ? C k = ? Xa Ya, Xb, Yb, Xk, Yk Need to calculate Xp, Xq. Cp, Cq, Xp, Xq can all use incremental methods Rate of color change!!

Using Incremental Methods Cx Cx+1 = Cx + (Cp –Cq)/(Xq-Xp)