Rasterizing Polygons 2 Lecture 35 Mon, Nov 26, 2007.

Slides:



Advertisements
Similar presentations
Polygon Scan Conversion – 11b
Advertisements

SI23 Introduction to Computer Graphics
Computer Graphics Inf4/MSc 1 Computer Graphics Lecture 7 Scanline algorithm and polygon clipping Taku Komura.
2-3 Slope Slope indicates the steepness of a line.
CS 4731: Computer Graphics Lecture 20: Raster Graphics Part 1 Emmanuel Agu.
Line Drawing Algorithms. Rasterization-Process of determining which pixels give the best approximation to a desired line on the screen. Scan Conversion-Digitizing.
30/9/2008Lecture 21 Computer Graphics Assistant Professor Dr. Sana’a Wafa Al-Sayegh 2 nd Semester ITGD3107 University of Palestine.
Polygon Rasterization
College of Computer and Information Science, Northeastern UniversityApril 17, CS U540 Computer Graphics Prof. Harriet Fell Spring 2009 Lecture 9.
Convex Hull obstacle start end Convex Hull Convex Hull
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
Bellwork Partner Activity for graphing.
3.1 – Paired Data and The Rectangular Coordinate System
6/2/ :35 AMIncremental Convex Hull1 q w u e zt.
Implementation Dr. Amy Zhang. Reading 2  Hill, Chapters  Hill, Chapter 10.
Rasterization May 14, Triangles Only We will discuss the rasterization of triangles only. Why? –Polygon can be decomposed into triangles. –A triangle.
Textures – Magnification and Minification Lecture 30 Mon, Nov 17, 2003.
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
1/1/20001 Topic >>>> Scan Conversion CSE Computer Graphics.
There’s a quiz on the table. Please take one and get started.
Informationsteknologi Monday, November 26, 2007Computer Graphics - Class 121 Today’s class Drawing lines Bresenham’s algorithm Compositing Polygon filling.
1Computer Graphics Implementation III Lecture 17 John Shearer Culture Lab – space 2
Computer Graphics using OpenGL, 3 rd Edition F. S. Hill, Jr. and S. Kelley Chapter 9.4 – 9.7 Tools for Raster Displays S. M. Lea University of North Carolina.
Scan Conversion. Last step in the graphics pipeline Efficiency is a central issue Common primitives – Lines (done last class) – Polygons (fill polygons,
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.
Lecture 15: Raster Graphics and Scan Conversion
1 CSCE 441: Computer Graphics Scan Conversion of Polygons Jinxiang Chai.
Computer Graphics Lecture 08 Taqdees A. Siddiqi Computer Graphics Filled Area Primitives I Lecture 08 Taqdees A. Siddiqi
Slope & Midpoint on the Coordinate Plane. SLOPE FORMULA Given two points (x 1,y 1 ) and (x 2,y 2 ) SLOPE The rate of change to get from one point to another.
Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 14.
Review Graphing of Linear Inequality y < -3x - 1.
Rasterization, or “What is glBegin(GL_LINES) really doing?” Course web page: February 23, 2012  Lecture 4.
CS552: Computer Graphics Lecture 16: Polygon Filling.
Since all points on the x-axis have a y-coordinate of 0, to find x-intercept, let y = 0 and solve for x Since all points on the y-axis have an x-coordinate.
Computer Graphics Filling.
3.3: Point-Slope Form.
Introduction to Polygons
CS G140 Graduate Computer Graphics
Warm Up Identify the slope and y-intercept of each equation. Then graph. 1. Y = -5X X + 5Y = X = Y = 12.
(c) 2002 University of Wisconsin, CS559
CS 4731: Computer Graphics Lecture 20: Raster Graphics Part 1
Computer Graphics Filled Area Primitives II Lecture 09 Taqdees A
Polygon Filling Algorithms
Equations of Lines in the Coordinate Plane
Prof. Harriet Fell Spring 2007 Lecture 9 – January 29, 2007
Rasterizing Lines 2 Lecture 33 Wed, Nov 14, 2007.
Objective- To find the slope of a line given
Rasterizing Lines 1 Lecture 32 Mon, Nov 12, 2007.
Lecture 7 MATLAB programming (5)
Slope of parallel and perpendicular lines postulate
Prepared by Narendra V G CSE MIT
Slope is the steepness of a line.
2.5 Linear Equations.
Prof. Harriet Fell Fall 2011 Lecture 9 – September 26, 2011
Day 6 – Vertical & Horizontal Lines
Drawing Walls for a Room
Graphing Linear Equations
Shading Polygons Lecture 36 Wed, Nov 28, 2007.
Write the equation for the following slope and y-intercept:
SLOPE.
Rasterizing Polygons Lecture 29 Wed, Dec 7, 2005.
Where We Stand At this point we know how to: Next thing:
Find the y-intercept and slope
Even better… write it as y = 3x – 6
Clipping Polygons Lecture 31 Fri, Nov 9, 2007.
1: Slope from Equations Y = 8x – 4 B) y = 6 – 7x
Visible-Surface Determination
Presentation transcript:

Rasterizing Polygons 2 Lecture 35 Mon, Nov 26, 2007

A Rasterization Algorithm The following algorithm is designed to allow rapid shading of the pixels. As the vertices are given, create a list of the vertices. (The order matters!) {(1, 0), (4, 3), (6, 1), (12, 1), (11, 8), (7, 8), (6, 5), (4, 8), (0, 7), (1, 0)}. From the list of vertices, form an edge table. {{(1, 0), (4, 3)}, {(4, 3), (6, 1)}, …, {(0, 7), (1, 0)}}.

A Rasterization Algorithm Organization of the edge table. Eliminate any horizontal edges. Sort the edges in the edge table by the y-coordinate of the lower endpoint. Begin scanning with the bottom scan line.

The Active Edge Table Create the active edge table (AET). For each edge in the edge table whose lower endpoint is on the scan line, Create an active-edge-table entry. Add it to the active edge table. Delete the edge from the edge table.

The Active Edge Table Organization of an active-edge-table entry: y-coordinate of upper endpoint. Reciprocal of the slope. x-intercept with the horizontal line ½ unit above the current scan line.

The Active Edge Table Active edges Scan line

The Active Edge Table (7, -1/7, 13/14) Scan line (3, 1, 1-1/2)

The Active Edge Table Sort the AET entries by their x-intercepts. The AET must contain an even number of entries. Why? Shade pixels from the 1st to the 2nd x-intercepts, 3rd to 4th x-intercepts, etc., in the AET.

The Active Edge Table (7, -1/7, 13/14) (no shading on Scan this scan line) Scan line (3, 1, 1-1/2)

The Active Edge Table Update the AET. Increment the scan line number. Delete from the AET any entries for which the upper endpoint is on the scan line. Update the x-intercepts of all AET entries. Add the reciprocal slope to the x-intercept. Create and add entries from the edge table for edges whose lower endpoint is on the scan line.

A Rasterization Algorithm (7, -1/7, 13/14) Scan line (3, 1, 1-1/2)

A Rasterization Algorithm (7, -1/7, 11/14) Scan line (8, -1/7, 11-13/14) (3, 1, 2-1/2) (3, -1, 5-1/2)

A Rasterization Algorithm (7, -1/7, 11/14) Scan line (8, -1/7, 11-13/14) (3, 1, 2-1/2) (3, -1, 5-1/2)

A Rasterization Algorithm (7, -1/7, 9/14) Scan line (8, -1/7, 11-11/14) (3, 1, 3-1/2) (3, -1, 4-1/2)

A Rasterization Algorithm (7, -1/7, 9/14) Scan line (8, -1/7, 11-11/14) (3, 1, 3-1/2) (3, -1, 4-1/2)

A Rasterization Algorithm (7, -1/7, 1/2) Scan line (8, -1/7, 11-9/14)

A Rasterization Algorithm (7, -1/7, 1/2) Scan line (8, -1/7, 11-9/14)

A Rasterization Algorithm (7, -1/7, 5/14) Scan line (8, -1/7, 11-1/2)

A Rasterization Algorithm (7, -1/7, 5/14) Scan line (8, -1/7, 11-1/2)

A Rasterization Algorithm (8, -2/3, 5-5/6) (8, 1/3, 6-1/6) (7, -1/7, 3/14) Scan line (8, -1/7, 11-5/14)

A Rasterization Algorithm (8, -2/3, 5-2/3) (8, 1/3, 6-1/6) (7, -1/7, 3/14) Scan line (8, -1/7, 11-5/14)

A Rasterization Algorithm (8, -2/3, 5) (8, 1/3, 6-1/2) (7, -1/7, 1/14) Scan line (8, -1/7, 11-3/14)

A Rasterization Algorithm (8, -2/3, 5) (8, 1/3, 6-1/2) (7, -1/7, 1/14) Scan line (8, -1/7, 11-3/14)

A Rasterization Algorithm (8, -2/3, 5) (8, 1/3, 6-1/2) (8, 4, 2) Scan line (8, -1/7, 11-3/14)

A Rasterization Algorithm (8, -2/3, 5) (8, 1/3, 6-1/2) (8, 4, 2) Scan line (8, -1/7, 11-3/14)

A Rasterization Algorithm

Rasterizing Polygons Read Run

Rasterizing Polygons in OpenGL Read Run

Freehand Polygons Read Run