Geometric Objects 2001. 7. 6 Computer Graphics Lab. Sun-Jeong Kim.

Slides:



Advertisements
Similar presentations
Computer Graphics- SCC 342
Advertisements

Line and Curve Drawing Algorithms. Line Drawing x0x0 y0y0 x end y end.
Computer Graphics 4: Bresenham Line Drawing Algorithm, Circle Drawing & Polygon Filling By:Kanwarjeet Singh.
CS 450: COMPUTER GRAPHICS REVIEW: DRAWING LINES AND CIRCLES SPRING 2015 DR. MICHAEL J. REALE.
+ CPCS 391 Computer Graphics 1 Instructor: Dr. Sahar Shabanah Lecture 3.
Line Drawing Algorithms. Rasterization-Process of determining which pixels give the best approximation to a desired line on the screen. Scan Conversion-Digitizing.
CS 450: COMPUTER GRAPHICS FILLING POLYGONS SPRING 2015 DR. MICHAEL J. REALE.
CP411 polygon Lecture 6 1. Scan conversion algorithm for circle 2. Draw polygons 3. Antialiasing.
CS 352: Computer Graphics Chapter 7: The Rendering Pipeline.
Direct Volume Rendering. What is volume rendering? Accumulate information along 1 dimension line through volume.
CS 376 Introduction to Computer Graphics 02 / 05 / 2007 Instructor: Michael Eckmann.
Output Primitives Computer Graphics.
Implementation Dr. Amy Zhang. Reading 2  Hill, Chapters  Hill, Chapter 10.
CMPE 466 COMPUTER GRAPHICS
Graphics Programming: Polygon Filling
CST 494/598 Computer Graphics Anshuman Razdan i3dea.asu.edu/razdan.
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.
Aliasing and Anti-Aliasing Copyright Zachary Wartell, University of North Carolina at Charlotte, All Rights Reserved Revision: 10/24/2007 3:38:00 AM ©Zachary.
Computer Graphics, KKU. Lecture 9
Introduction to 3D Graphics John E. Laird. Basic Issues u Given a internal model of a 3D world, with textures and light sources how do you project it.
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.
Mathematics for Computer Graphics (Appendix A) Won-Ki Jeong.
CGMB214: Introduction to Computer Graphics
7.1 Scalars and vectors Scalar: a quantity specified by its magnitude, for example: temperature, time, mass, and density Chapter 7 Vector algebra Vector:
Computer Graphics Panos Trahanias ΗΥ358 Spring 2009.
1/1/20001 Topic >>>> Scan Conversion CSE Computer Graphics.
Dr. S.M. Malaek Assistant: M. Younesi
Graphics Graphics Korea University cgvr.korea.ac.kr Raster Graphics 고려대학교 컴퓨터 그래픽스 연구실.
WHERE TO DRAW A LINE?? Line drawing is accomplished by calculating intermediate positions along the line path between specified end points. Precise definition.
Mathematical Foundations Sections A-1 to A-5 Some of the material in these slides may have been adapted from university of Virginia, MIT and Åbo Akademi.
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:
Graphics Graphics Korea University cgvr.korea.ac.kr Raster Graphics 고려대학교 컴퓨터 그래픽스 연구실.
C O M P U T E R G R A P H I C S Guoying Zhao 1 / 14 C O M P U T E R G R A P H I C S Guoying Zhao 1 / 14 Going-through.
10/26/04© University of Wisconsin, CS559 Fall 2004 Last Time Drawing lines Polygon fill rules Midterm Oct 28.
Graphics Graphics Korea University Mathematics for Computer Graphics Graphics Laboratory Korea University.
Graphics Output Primitives
Line Drawing and Generalization. Outline  overview  line drawing  circle drawing  curve drawing.
2D Output Primitives Points Lines Circles Ellipses Other curves Filling areas Text Patterns Polymarkers.
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.
Attributes of Graphics Primitives Hearn & Baker Chapter 4 Some slides are taken from Robert Thomsons notes.
GEOMETRY AND LINE GENERATION Geometry and Line Generation Chapter 2.
In the name of God Computer Graphics. Today Introduction Sampling Graphic Output Primitives 1.Line 2.Circle 3.Curve 4.polygon.
2D Output Primitives Points Lines Circles Ellipses Other curves Filling areas Text Patterns Polymarkers.
Lecture 15: Raster Graphics and Scan Conversion
1 CSCE 441: Computer Graphics Scan Conversion of Polygons Jinxiang Chai.
CS552: Computer Graphics Lecture 17: Scan Conversion (Special Cases)
Computer Graphics CC416 Week 14 Filling Algorithms.
Attributes of Graphics Primitives Chapter 4
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.
Chun-Yuan Lin Coordinate Reference Frames 2016/6/22 1 CG.
10/10/2006TCSS458A Isabelle Bichindaritz1 Line and Circle Drawing Algorithms.
Computer Graphics I, Fall 2010 Scan conversion algorithms.
OUTPUT PRIMITIVES CEng 477 Computer Graphics METU, 2004.
Raster Graphics.
Attributes of Graphics Primitives Hearn & Baker Chapter 4
Chapter Three Part I Output Primitives CS 380.
Geometry – Pre-requisite Skills Mr. Rosilez
Agenda Polygon Terminology Types of polygons Inside Test
Agenda Polygon Terminology Types of polygons Inside Test
Chapter 3 Graphics Output Primitives
Primitive Drawing Algorithm
NOTE.
Primitive Drawing Algorithm
Polygons.
Presentation transcript:

Geometric Objects Computer Graphics Lab. Sun-Jeong Kim

Korea University Computer Graphics -2- Points  Single Coordinate Position  Set the bit value(color code) corresponding to a specified screen position within the frame buffer x y setPixel (x, y)

Korea University Computer Graphics -3- Lines  Intermediate Positions between Two Endpoints  DDA, Bresenham’s line algorithms Jaggies = Aliasing

Korea University Computer Graphics -4- DDA Algorithm  Digital Differential Analyzer  Slope >= 1  Unit x interval = 1  0 < Slope < 1  Unit y interval = 1  Slope <= -1  Unit x interval = -1  -1 < Slope < 0  Unit y interval = -1 x1 y1 x2 y2 x1 y1 x2 y2 x1 y1 x2 y2 x1 y1 x2 y2

Korea University Computer Graphics -5- Bresenham ’ s Line Algorithm  Midpoint Line Algorithm  Decision variable NE M Q  d > 0 : choose NE  : d new = d old +a  d <= 0 : choose E  : d new = d old +a+b P(x p, y p )E

Korea University Computer Graphics -6- Bresenham ’ s Algorithm(cont.)  Initial Value of d  Update d

Korea University Computer Graphics -7- Polygons  Filling Polygons  Scan-line fill algorithm  Inside-Outside tests  Boundary fill algorithm

Korea University Computer Graphics -8- Scan-Line Polygon Fill  Topological Difference between 2 Scan lines  y : intersection edges are opposite sides  y’ : intersection edges are same side y y’

Korea University Computer Graphics -9- Scan-Line Polygon Fill (cont.)  Edge Sorted Table C C’ B D E A 0 1 yAyA yDyD yCyC Scan-Line Number yEyE xAxA 1/m AE yByB xAxA 1/m AB y C’ xDxD 1/m DC yEyE xDxD 1/m DE yByB xCxC 1/m CB

Korea University Computer Graphics -10- Inside-Outside Tests  Self-Intersections  Odd-Even rule  Nonzero winding number rule exterior interior

Korea University Computer Graphics -11- Boundary-Fill Algorithm  Proceed to Neighboring Pixels  4-Connected  8-Connected

Korea University Computer Graphics -12- Antialiasing  Aliasing  Undersampling: Low-frequency sampling  Nyquist sampling frequency:  Nyquist sampling interval:

Korea University Computer Graphics -13- Antialiasing (cont.)  Supersampling (Postfiltering)  Pixel-weighting masks  Area Sampling (Prefiltering)  Pixel Phasing  Shift the display location of pixel areas  Micropositioning the electron beam in relation to object geometry

Korea University Computer Graphics -14- Supersampling  Subpixels  Increase resolution (10, 20): Maximum Intensity (11, 21): Next Highest Intensity (11, 20): Lowest Intensity

Korea University Computer Graphics -15- Pixel-Weighting Masks  Give More Weight to Supixels Near the Center of a Pixel Area

Korea University Computer Graphics -16- Area Sampling  Set Each Pixel Intensity Proportional to the Area of Overlap of Pixel  2 Adjacent vertical (or horizontal) screen grid lines  trapezoid (10, 20): 90% (10, 21): 15%

Korea University Computer Graphics -17- Filtering Techniques  Filter Functions (Weighting Surface) Box FilterCone FilterGaussian Filter

Mathematics for CG

Korea University Computer Graphics -19- Coordinate Reference Frames  2D Cartesian Reference Frames x y x y

Korea University Computer Graphics D Polar Coordinate Reference Frame

Korea University Computer Graphics D Cartesian Reference Frame  Right-Handed v.s. Left-Handed Right-handedLeft-handed

Korea University Computer Graphics D Curvilinear Coordinate Systems  General Curvilinear Reference Frame  Orthogonal coordinate system  Each coordinate surfaces intersects at right angles

Korea University Computer Graphics -23- Cylindrical-Coordinate : radius of vertical cylinder : vertical plane containing z-axis : horizontal plane parallel to xy-plane constant Transform to Cartesian coordinator x axis y axis z axis

Korea University Computer Graphics -24- Spherical-Coordinate : radius of sphere : vertical plane containing z-axis : cone with the apex at the origin constant Transform to Cartesian coordinator x axis y axis z axis

Korea University Computer Graphics -25- Solid Angle  3D Angle Defined on a Sphere  Steradian Steradian : Total solid angle : steradian

Korea University Computer Graphics -26- Points & Vectors  Point  Position in some reference frame  Distance from the origin depends on the reference frame P Frame B Frame A x y

Korea University Computer Graphics -27- Points & Vectors (cont.)  Vector  Difference between two point positions  Properties : Magnitude & direction  Same properties within a single coordinate system  Magnitude is independent from coordinate frames Magnitude : Direction :

Korea University Computer Graphics D Vector  Magnitude  Directional angle

Korea University Computer Graphics -29- Vector Addition & Scalar Multiplication  Addition  Scalar multiplication

Korea University Computer Graphics -30- Vector Multiplication  Scalar Product(Inner Product) Commutative : Distributive : Orthogonal :

Korea University Computer Graphics -31- Vector Multiplication (cont.)  Vector Product(Cross Product) Noncommutative : Nonassociative : Distributive : Right-handed rule!