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?

Slides:



Advertisements
Similar presentations
Parallel Lines & Transversals
Advertisements

CMPE 466 COMPUTER GRAPHICS
CS 450: COMPUTER GRAPHICS FILLING POLYGONS SPRING 2015 DR. MICHAEL J. REALE.
Computer Graphics Scan Conversion Polygon Faculty of Physical and Basic Education Computer Science Dep Lecturer: Azhee W. MD.
Angle Relationships Vocabulary
Informationsteknologi Wednesday, November 7, 2007Computer Graphics - Class 51 Today’s class Geometric objects and transformations.

The Cartesian Coordinate System
Graphics Programming: Polygon Filling
CS 454 Computer graphics Polygon Filling
Geometric Algorithms1 segment intersection orientation point inclusion simple closed path.
TOPIC 4 PART III FILL AREA PRIMITIVES POLYGON FILL AREAS CGMB214: Introduction to Computer Graphics.
GEOMETRY PRE-UNIT 4 VOCABULARY REVIEW ALL ABOUT ANGLES.
1 Computer Graphics Assistant Professor Dr. Sana’a Wafa Al-Sayegh 2 nd Semester ITGD3107 University of Palestine.
March Shape Drawing Algorithms Shmuel Wimer Bar Ilan Univ., Engineering Faculty.
CS-321 Dr. Mark L. Hornick 1 3-D Object Modeling.
CS 450: Computer Graphics REVIEW: OVERVIEW OF POLYGONS
CGMB 314 Intro to Computer Graphics Fill Area Primitives.
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.
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:
10/15/02 (c) 2002 University of Wisconsin, CS559 Last Time Clipping.
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.
Line and Angle Relationships Sec 6.1 GOALS: To learn vocabulary To identify angles and relationships of angles formed by tow parallel lines cut by a transversal.
Parallel lines, transversals and angles
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.
Rotations.
Attributes of drawing elements
Geometry MSM2.
2.3 Adding Integers 1 Medina.  Negative number – a less than zero  Positive number – a greater than zero. 2Medina.
More Trig – Angles of Rotation Learning Objective: To find coterminal and reference angles and the trig function values of angles in standard position.
Lesson 5 Definition of Rotation and Basic Properties
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.
Warm Up 1.) Name a line that contains C. 2.) Name a ray with endpoint B that contains A. 3.) Name an angle with vertex B that contains C. 4.) Name a segment.
2D Output Primitives Points Lines Circles Ellipses Other curves Filling areas Text Patterns Polymarkers.
Transversals + Parallel lines Obj: to use the properties of transversals to solve angle problems.
Lecture 15: Raster Graphics and Scan Conversion
Parallel Lines and Transversals. Congruent Angles Angles that have the same measurement.
Warm-Up Match the symbols > Line segment  Ray II Perpendicular 
Topic 2 Summary Transformations.
Chapter 3 Perpendicular & Parallel Lines Sec. 3.1 Lines and Angles GOALS: To identify relationships between lines and angles formed by transversals.
Unit 3 Definitions. Parallel Lines Coplanar lines that do not intersect are called parallel. Segments and rays contained within parallel lines are also.
Absolute Value and Translations Section 6-8. Notes The absolute value is the distance a number is away from zero. Because distance can never be negative.
3.1 & 3.2 Identify Pairs of Lines and Angles Use Parallel Lines and Transversals.
3.1 & 3.2 Identify Pairs of Lines and Angles Use Parallel Lines and Transversals.
+ Angles and Lines. + What do we know about angles?
Angles continued Interior Angles are those angles inside the parallel lines. Exterior Angles are those angles outside the parallel lines.
Geometry. Definitions Geometry Definitions 1.straight angle - 180º.
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
Parallel Lines & Transversals. Transversal A line, ray, or segment that intersects 2 or more COPLANAR lines, rays, or segments.
3.1 Lines and Angles.
Computer Graphics Filling.
Polygons.
(c) 2002 University of Wisconsin, CS559
Midterm Review Computer Graphics Hardware Point and Line Drawing
© University of Wisconsin, CS559 Fall 2004
Add Subtract Positive Negative integers
Prof. Harriet Fell Fall 2011 Lecture 9 – September 26, 2011
Windowing Push-Pull Systems
Ray Tracing Polyhedra ©Anthony Steed
Parallel Lines & Transversals
Pairs of Lines and Angles
Angles on Lines and Figures Vocabulary
TRANSVERSAL VOCABULARY
Objectives: Identify parallel and perpendicular lines
TRANSVERSAL VOCABULARY
Type to enter a caption. Computer Graphics Week 5 Lecture 1.
Add and Subtract Positive & Negative Integers
Presentation transcript:

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? Can we determine if a point is inside a shape?

3 A Filling Anomaly

CS-321 Dr. Mark L. Hornick 4 One Approach: The Odd-Even Rule 1. Choose an arbitrary point 2. Draw ray to a distant point Don’t intersect any vertices What’s a “distant” point? 3. Count edges crossed Odd count means interior Even count means exterior

CS-321 Dr. Mark L. Hornick 5 Odd-Even Result

CS-321 Dr. Mark L. Hornick 6 Another approach: Nonzero Winding Rule Choose a point Draw ray to a distant point Don’t intersect any vertices Consider edges crossed (right hand rule) Subtract 1 when ray to edge is clockwise Add 1 when ray to edge is counter-clockwise Nonzero count means interior Count = “Winding number”

CS-321 Dr. Mark L. Hornick 7 Nonzero Winding Example −1 −2

CS-321 Dr. Mark L. Hornick 8 Computing Winding Number Compute cross product Between ray and edge Sign of z value determines direction +z implies CCW (add 1 to winding number) See text, page 128

CS-321 Dr. Mark L. Hornick 9 Cross Product Example u=(1,1,0) V B =(2,0,0) V A =(1,0,0) E “−1” means u crosses E clockwise

CS-321 Dr. Mark L. Hornick 10 Cross Product Simplification negative means clockwise

CS-321 Dr. Mark L. Hornick 11 Computing Winding Number Compute dot product Use perpendicular to ray vs. edge If ray is given by (u x, u y ), perpendicular is (- u y, u x ) Sign of product determines direction +product implies “right-to-left” (add 1 to winding number) See text, page 128

CS-321 Dr. Mark L. Hornick 12 Dot Product Example Again, “−1” means u crosses E from left to right u=(1,1,0), w = (−1,1,0) [“right-to-left” perpendicular to u] V B =(2,0,0) V A =(1,0,0) E

CS-321 Dr. Mark L. Hornick 13 Dot Product Simplification Same result as from cross product!

CS-321 Dr. Mark L. Hornick 14 Inside-Outside Tests Summary Odd-even rule Generalized from scan-line fill May produce unusual results if edges intersect Nonzero winding number rule Alternate way of determining interior