More Raster Line Issues. Bresenham Circles. Once More: 8-Pt Symmetry. Only 1 Octant Needed. Spring 2013 CS5600

Similar documents
CPSC / Scan Conversion

From Vertices to Fragments: Rasterization. Reading Assignment: Chapter 7. Special memory where pixel colors are stored.

Output Primitives. Dr. S.M. Malaek. Assistant: M. Younesi

From Ver(ces to Fragments: Rasteriza(on

Line Drawing. Introduction to Computer Graphics Torsten Möller / Mike Phillips. Machiraju/Zhang/Möller

Line Drawing Week 6, Lecture 9

Scan Conversion. Drawing Lines Drawing Circles

0. Introduction: What is Computer Graphics? 1. Basics of scan conversion (line drawing) 2. Representing 2D curves

Line Drawing. Foundations of Computer Graphics Torsten Möller

Computer Graphics. - Rasterization - Philipp Slusallek

EF432. Introduction to spagetti and meatballs

Raster Graphics Algorithms

Rendering. A simple X program to illustrate rendering

(a) Find the equation of the plane that passes through the points P, Q, and R.

UNIT -8 IMPLEMENTATION

(Refer Slide Time: 00:03:51)

CS 130. Scan Conversion. Raster Graphics

Announcements. Midterms graded back at the end of class Help session on Assignment 3 for last ~20 minutes of class. Computer Graphics

CS 4731: Computer Graphics Lecture 21: Raster Graphics: Drawing Lines. Emmanuel Agu

CS 450: COMPUTER GRAPHICS REVIEW: DRAWING LINES AND CIRCLES SPRING 2015 DR. MICHAEL J. REALE

Renderer Implementation: Basics and Clipping. Overview. Preliminaries. David Carr Virtual Environments, Fundamentals Spring 2005

Computer Graphics : Bresenham Line Drawing Algorithm, Circle Drawing & Polygon Filling

Figure 1: Schematic of an SEM [source: ]

Raster Displays and Scan Conversion. Computer Graphics, CSCD18 Fall 2008 Instructor: Leonid Sigal

Graphics (Output) Primitives. Chapters 3 & 4

Lecture 6 of 41. Scan Conversion 1 of 2: Midpoint Algorithm for Lines and Ellipses

Lecture 6 of 41. Scan Conversion 1 of 2: Midpoint Algorithm for Lines and Ellipses

Chapter 8: Implementation- Clipping and Rasterization

Topic #1: Rasterization (Scan Conversion)

Graphics System. Processor. Output Display. Input Devices. Frame Buffer. Memory. Array of pixels. Resolution: # of pixels Depth: # of bits/pixel

Topic 0. Introduction: What Is Computer Graphics? CSC 418/2504: Computer Graphics EF432. Today s Topics. What is Computer Graphics?

Rasterization: Geometric Primitives

Rasteriza2on and Clipping

EF432. Introduction to spagetti and meatballs

Rasterization, or What is glbegin(gl_lines) really doing?

MODULE - 4. e-pg Pathshala

OpenGL Graphics System. 2D Graphics Primitives. Drawing 2D Graphics Primitives. 2D Graphics Primitives. Mathematical 2D Primitives.

CSCI 4620/8626. Coordinate Reference Frames

Rendering approaches. 1.image-oriented. 2.object-oriented. foreach pixel... 3D rendering pipeline. foreach object...

Computer Graphics. Lecture 2. Doç. Dr. Mehmet Gokturk

CONSTRUCTION AND ANALYSIS OF INVERSIONS IN S 2 AND H 2. Arunima Ray. Final Paper, MATH 399. Spring 2008 ABSTRACT

In today s lecture we ll have a look at: A simple technique The mid-point circle algorithm

CS 543: Computer Graphics. Rasterization

Incremental Form. Idea. More efficient if we look at d k, the value of the decision variable at x = k

Tópicos de Computação Gráfica Topics in Computer Graphics 10509: Doutoramento em Engenharia Informática. Chap. 2 Rasterization.

Filtering Edges for Gray-Scale Displays

Rendering. A simple X program to illustrate rendering

Scan Conversion. Lines and Circles

Scan Conversion. CMP 477 Computer Graphics S. A. Arekete

Math 131. Implicit Differentiation Larson Section 2.5

(Refer Slide Time: 9:36)

UNIT 2 GRAPHIC PRIMITIVES

Department of Computer Sciences Graphics Fall 2003 (Lecture 2) Pixels

Computer Graphics Prof. Sukhendu Das Dept. of Computer Science and Engineering Indian Institute of Technology, Madras Lecture - 14

1 Introduction to Graphics

Prof. Feng Liu. Fall /25/2018

2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into

The Traditional Graphics Pipeline

R asterisation. Part I: Simple Lines. Affine transformation. Transform Render. Rasterisation Line Rasterisation 2/16

Rasterization and Graphics Hardware. Not just about fancy 3D! Rendering/Rasterization. The simplest case: Points. When do we care?

Lecture 2: Digital Drawing. Computer Graphics and Imaging UC Berkeley CS184/284

The Traditional Graphics Pipeline

Holy Halved Heaquarters Riddler

Painter s HSR Algorithm

CS Rasterization. Junqiao Zhao 赵君峤

Computer Graphics Chapter 7 Three-Dimensional Viewing Viewing

Rasterization. CS4620/5620: Lecture 12. Announcements. Turn in HW 1. PPA 1 out. Friday lecture. History of graphics PPA 1 in 4621.

Chapter 3. Sukhwinder Singh

Computer Graphics. Chapter 4 Attributes of Graphics Primitives. Somsak Walairacht, Computer Engineering, KMITL 1

The Traditional Graphics Pipeline

Lossy Coding 2 JPEG. Perceptual Image Coding. Discrete Cosine Transform JPEG. CS559 Lecture 9 JPEG, Raster Algorithms

6 Gradient Descent. 6.1 Functions

Computer Organization

Einführung in Visual Computing

Computer Graphics: Graphics Output Primitives Line Drawing Algorithms

Chapter - 2: Geometry and Line Generations

CS 4300 Computer Graphics. Prof. Harriet Fell Fall 2012 Lecture 5 September 13, 2012

4.2 Implicit Differentiation

Unit #5 - Implicit Differentiation, Related Rates Section 3.7

Output Primitives Lecture: 3. Lecture 3. Output Primitives. Assuming we have a raster display, a picture is completely specified by:

Scan Converting Lines

Computer Graphics D Graphics Algorithms

Efficient Plotting Algorithm

(Refer Slide Time: 00:02:00)

Computer Graphics (CS 543) Lecture 10: Rasterization and Antialiasing

Bends, Jogs, And Wiggles for Railroad Tracks and Vehicle Guide Ways

Raster Scan Displays. Framebuffer (Black and White)

Introduction to Computer Graphics (CS602) Lecture 05 Line Drawing Techniques

State Indexed Policy Search by Dynamic Programming. Abstract. 1. Introduction. 2. System parameterization. Charles DuHadway

Computer Graphics. Attributes of Graphics Primitives. Somsak Walairacht, Computer Engineering, KMITL 1

Rasterization. CS 4620 Lecture Kavita Bala w/ prior instructor Steve Marschner. Cornell CS4620 Fall 2015 Lecture 16

Computer Graphics D Graphics Algorithms

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Computer Graphics

Aliasing and Antialiasing. ITCS 4120/ Aliasing and Antialiasing

Lecture 2 March 24, 2004

Learning convex bodies is hard

COMP371 COMPUTER GRAPHICS

Realtime 3D Computer Graphics Virtual Reality

Properties of the Derivative Lecture 9.

PART 2. Organization Of An Operating System

Transcription:

Spring 03 Lecture Set 3 Bresenham Circles Intro to Computer Graphics From Rich Riesenfel Spring 03 More Raster Line Issues Fat lines with multiple pixel with Symmetric lines n point geometry how shoul it look? Generating curves, e.g., circles, etc. Jaggies, staircase effect, aliasing... Spring 03 CS 5600 Generating Circles xploit 8-Point Symmetry ( y, x) ( y, x), y), y), y), y) ( y, x) ( y, x) Once More: 8-Pt Symmetry ( y, x) ( y, x) Only Octant Neee We will generate n Octant, y), y), y), y) ( y, x) ( y, x)

Spring 03 Generating pt (x,y) gives the following 8 pts by symmetry: {(x,y), (-x,y), (-x,-y), (x,-y), (y,x), (-y,x), (-y,-x), (y,-x)} n Octant Is a Goo Arc It is a function in this omain single-value no vertical tangents: slope Lens itself to Bresenham only nee consier or S Implicit q s for Circle Let F(x,y) = x + y r For(x,y) on the circle, F(x,y) = 0 So, F(x,y) > 0 (x,y) Outsie An, F(x,y) < 0 (x,y) Insie Choose or S Function is x + y r = 0 So, F(M) 0 S An, F(M) < 0 F(M) 0 S F(M) < 0 ieal curve M ieal curve M S S

Spring 03 Decision Variable Again, we let, = F(M ) ieal curve Look at Case : M S ol < 0 ol < 0 (, ol F x p y p ) p ) ( y p ) r (, new F x p y p ) ) ( ) p y p r ol < 0 ol < 0 Since, ( 3) new ol x p new ol ( ) ( ) x p x p p x p 3 x p ) p x p ) where, new ol x 3 p,

Spring 03 ieal curve Look at Case : S M S ol 0 S 3 new F p, y p ) 3 ) ( ) p y p r new ol (xp y p 5) Because,, straightforwar manipulation ol 0 S ol 0 S new ol 3 p ) ( y p ) r ( x ) ( y ) r p p new ol 3 p ) ( y p ) xr ( x ) ( y ) r p p x = (x p 3) y p 9 3 y p y p y p = (x p 3) y p 9 3 y p y p y p ol 0 S ol 0 S new ol 3 p ) ( y p ) xr ( x ) ( y ) r p p x = (x p 3) yx p 9 3 y p yx p y p new 9 ( x p 3) ( 3 y p ) ( y ) p From calculation ol From new y-coorinate From ol y-coorinate

Spring 03 I.e., ol 0 S (x y 5) new ol p p ol S x y 5 S p p Note: s Not Constant an S epen on values of x p an y p Summary s are no longer constant over entire line Algorithm structure is exactly the same Major ifference from the line algorithm is re-evaluate at each step Requires real arithmetic Initial Conition Let r be an integer. Start at ( 0, r) Next mipoint M lies at (, r ) So, F r r (, ) ( r ) r 5 r valuation is analogous Structure is same Have to work out the s llipses Getting to Integers Note the previous algorithm involves real arithmetic Can we moify the algorithm to use integer arithmetic?

Spring 03 Integer Circle Algorithm Integer Circle Algorithm Define a shift ecision variable h In the coe, plug in h Now, the initialization is h = - r So the initial value becomes 5 F (, r ) ( r) r Integer Circle Algorithm Then, 0 becomes h Since h an integer h h 0 Integer Circle Algorithm But,h begins as an integer An, h gets incremente by integer Hence, we have an integer circle algorithm Note: Sufficient to test for h < 0 n of Bresenham Circles Another Digital Line Issue Clipping Bresenham lines The integer slope is not the true slope Have to be careful More issues to follow

Spring 03 Line Clipping Problem Clippe Line x x x x max y y max, y ) Clipping Rectangle 0, y0 ), y ) Clipping Rectangle 0, y 0 ) y y x x x x max y y Drawing Clippe Lines Clippe Line Has Different Slope!, y ) m 0, y 0 ) m 3 Pick Right Slope to Reprouce Original Line Segment Pick Right Slope to Reprouce Original Line Segment Zoom of previous situation Zoom of previous situation

Spring 03 Clipping Against x = x x x, Roun ( mx )) B N M mipoint Clipping Against y = y x x B A Line getting clippe y y,( mx B)) Clip Rectangle y y y y y y Clipping Against y = y Situation is complicate Multiple pixels involve at (y = y ) Want all of those pixels as in Analytic, rouning x gives A We want point B Clipping Against y = y Use Line y = y - ½ Roun up to nearest integer x This yiels point B, the esire result Jaggies-Manifestation of Aliasing Ae resolution helps, but oes not irectly aress unerlying issue of aliasing Jaggies an Aliasing To represent a line with iscrete pixel values is to sample finitely a continuous function Jaggies are visual manifestation, artifacts, resulting from information loss The term aliasing is a complicate, unintuitive phenomenon which will be efine later

Spring 03 Jaggies an Aliasing Anti-aliasing Doubling resolution in x an y reuces the effect of the problem, but oes not fix it Doubling resolution costs times memory, memory banwith an scan conversion time! 5 3 0 0 3 5 6 7 8 9 0 Pixel Space Pixel intensity (arkness, in this case) is proportional to area covere by line Anti-aliasing Anti-aliasing Pixel Space Pixel intensity (arkness, in this case) is proportional to area covere by line Set each pixel s intensity value proportional to its area of overlap (i.e. sub-area) covere by primitive Not more than pixel/column for lines with 0 < slope < Gupta-Sproull Algorithm - Gupta-Sproull Algorithm - Stanar Bresenham chooses or N Incrementally compute istance D from chosen pixel to center of line Vary pixel intensity by value of D Do this for line above an below Use coarse (-bit, say) lookup table for intensity : Filter (D,t) Note, Filter value epens only on D an t, not the slope of line! (Very clever) For line_with t = geometry an associate calculations greatly simplify

Spring 03 Cone Filter for Weighte Area Sampling t r D Unit thickness line intersects no more than 3 pixels Observations Lines are complicate Many aspects to consier We omitte many What about intensity of y = x vs y = 0? Lecture Set 3 The n Bresenham Circles