Part 6: Graphics Output Primitives (4) 1.  Another useful construct,besides points, straight line segments, and curves for describing components of a.

Slides:



Advertisements
Similar presentations
Computer Graphics- SCC 342
Advertisements

COMP 175 | COMPUTER GRAPHICS Remco Chang1/6103b – Shapes Lecture 03b: Shapes COMP 175: Computer Graphics February 3, 2015.
CMPE 466 COMPUTER GRAPHICS
Computer Graphics Scan Conversion Polygon Faculty of Physical and Basic Education Computer Science Dep Lecturer: Azhee W. MD.
Viewing & Clipping In 2D. 2 of 44 Contents Windowing Concepts Clipping –Introduction –Brute Force –Cohen-Sutherland Clipping Algorithm Area Clipping –Sutherland-Hodgman.
Geometry Day 41 Polygons.
 3.3: Angles of Polygons. What is a Polygon?  A polygon is a closed plane figure made up of three or more line segments that intersect only at their.
Unit 3 Comp 4 Interior/Exterior Angles of a Polygon
Classes of Polygons Planar polygons Non-planar polygons Simple
THE WORLD OF POLYGONS LESSON 4.
Informationsteknologi Wednesday, November 7, 2007Computer Graphics - Class 51 Today’s class Geometric objects and transformations.
CS 450: Computer Graphics OVERVIEW OF POLYGONS
Computer Graphics - Class 14
Circle Drawing algo..
TOPIC 4 PART III FILL AREA PRIMITIVES POLYGON FILL AREAS CGMB214: Introduction to Computer Graphics.
Modeling. Topology Topology describes an object’s shape, number of spans, and degree. For polygon objects this includes vertex positions.
1 Computer Graphics Assistant Professor Dr. Sana’a Wafa Al-Sayegh 2 nd Semester ITGD3107 University of Palestine.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
March Shape Drawing Algorithms Shmuel Wimer Bar Ilan Univ., Engineering Faculty.
Polygon Shading. Assigning color to a shape to make graphical scenes look realistic, or artistic, or whatever effect we’re attempting to achieve But first.
CS-321 Dr. Mark L. Hornick 1 3-D Object Modeling.
CS 450: Computer Graphics REVIEW: OVERVIEW OF POLYGONS
Introduction to 3D Graphics Lecture 4: Scenes and Scene Graphs Anthony Steed University College London.
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.
Two-Dimensional Viewing
Today we will be learning about
Vertex – A point at which two or more edges meet Edge – A line segment at which two faces intersect Face – A flat surface Vertices, Edges, Faces.
Geometry: From Triangles to Quadrilaterals and Polygons.
Computer Graphics 2D Transformations. 2 of 74 Contents In today’s lecture we’ll cover the following: –Why transformations –Transformations Translation.
Geometric Objects and Transformation
Polygons A Polygon is a closed plane figure formed by 3 or more segments Each segment intersects exactly 2 other segments only at their endpoints. No.
Section 3.5 Polygons A polygon is:  A closed plane figure made up of several line segments they are joined together.  The sides to not cross each other.
Here are the eight semi-regular tessellations:
16/5/ :47 UML Computer Graphics Conceptual Model Application Model Application Program Graphics System Output Devices Input Devices API Function.
Computer Graphics Basic 3D Geometry CO2409 Computer Graphics Week 5-1.
CS 325 Introduction to Computer Graphics 03 / 29 / 2010 Instructor: Michael Eckmann.
Vertices, Edges and Faces By Jordan Diamond. Vertices In geometry, a vertices is a special kind of point which describes the corners or intersections.
1 11. Polygons Polygons 2D polygons ( 다각형 ) –Polygon sides are all straight lines lying in the same plane 3D polyhedra ( 다면체 )  chap. 12 –Polyhedra.
12.1 Exploring Solids.
Polygons and Solids. Helix - Volume or solid of spiral shape that turns at a constant angle. cylinder -Volume or solid generated by the rotation.
In the name of God Computer Graphics Bastanfard. Curve Function(2) Other method is approximate it using a poly-line. Just locate a set of points along.
Lecture 15: Raster Graphics and Scan Conversion
CLASSIFYING POLYGONS UNIT 1 LESSON 6. Classifying Polygons In geometry, a figure that lies in a plane is called a plane figure. A polygon is a closed.
Introduction to Meshes Lecture 22 Mon, Oct 20, 2003.
11 Chapter Introductory Geometry
Unit 10 Transformations. Lesson 10.1 Dilations Lesson 10.1 Objectives Define transformation (G3.1.1) Differentiate between types of transformations (G3.1.2)
Shapes Polygons, Symmetry, Nets Hexahedron Tetrahedron.
OUTPUT PRIMITIVES A.Aruna/Faculty of Information technology/SNSCE13/19/2016.
Polygons A polygon is a plane shape with straight sides.
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 CC416 Lecture 04: Bresenham Line Algorithm & Mid-point circle algorithm Dr. Manal Helal – Fall 2014.
Introduction to Transformations / Translations. By the end of this lesson, you will know… Transformations in general: A transformation is a change in.
Exploring Angle Pairs Unit 1 Lesson 5. Exploring Angle Pairs Students will be able to: Identify Special Angle Pairs and use their relationships to find.
Lecture 5 Basic geometric objects
Introduction to Polygons
Computer Graphics CC416 Week 13 Clipping.
Computer Graphics Filled Area Primitives II Lecture 09 Taqdees A
Basic Vocabulary Student Friendly: I will be able to define an angle, circle, perpendicular lines, parallel lines, and line segments using the definition.
COORDINATE PLANE The plane containing the "x" axis and "y" axis.
Exploring Angle Pairs Unit 1 Lesson 5.
11 Chapter Introductory Geometry
10.1 Solid Geometry Geometry.
Rotations on the Coordinate Plane
Introduction to Meshes
Standard:.
A Presentation On Polygon
A polygon is a plane figure with three or more than three segments.
Polygons.
Introduction to Meshes
Presentation transcript:

Part 6: Graphics Output Primitives (4) 1

 Another useful construct,besides points, straight line segments, and curves for describing components of a picture is an area that is filled with some solid color or pattern. A picture component of this type is typically referred to as a fill area or filled area.  Although any filled shape is possible, graphics libraries generally do not support specifications for arbitrary fill shapes.  Most library routines require that a fill area be specified as a polygon. 2

 Graphics routines can more efficiently process polygons than other kinds of fill shapes because polygon boundaries are described with linear equations.  Approximating a curved surface with polygon facets is sometimes referred to as surface tessellation. 3

 Mathematically defined, a polygon is a plane figure specified by a set of three or more coordinate positions called vertices that are connected in sequence by straight line segments called the edges.  Further in basic geometry it is required that the polygon edges have no common point other than their end points.  Thus, by definition a polygon must have all its vertices on the same plane. And there can be no edges crossings. 4

 An interior angle of a polygon is an angle inside the polygon boundary that is formed by two adjacent edges.  If all interior angles of a polygon are less or equal 180 degrees, the polygon is a convex polygon.  Otherwise if the polygon has an angle with greater than 180 degrees it is called a concave polygon.  Concave polygons also present problems. Implementations of fill algorithms and other graphics routines are more complicated for concave polygons, so it is generally more efficient to split a concave into a set of convex polygons before processing. 5

convex polygon (a) concave polygon (b) 6

 If we set up a vector for each polygon edge, then we can use the cross produce of adjacent edges to test for concavity.  All such vector products will be of the same sign( positive or negative) for a convex polygon.  Therefore, if some cross products yield a positive value and some a negative value we have a concave polygon. 7

x y V6 E1 E3 E2 V1 E4 E6 E5 V4 V3 V2 V5 (E1 X E2) >0 (E2 X E3) >0 (E3 X E4) <0 (E4 X E5) >0 (E5 X E6) >0 (E6 X E1) >0 8

 Once we have identified that we have a concave polygon we must split it into a set of convex polygons, we have two methods for splitting the concave : 1- The vector method. 2- The rotational method. 9

 With this method we first need to form the edge vectors, consider consecutive edge vectors V k, and V k+1, we define the edge vector between them as : Ek=V k+1 – V k  Now we calculate the edge vectors cross product and define where is the vertex that caused the concave to appear. 10

 If the value of some cross product is positive while the others are negative the polygon is concave,else, it is a convex.  To illustrate the vertex method we do the following example : 11

 Given a concave polygon with six edges, for this shape the edges are expressed as: E1 =(1,0,0) E2=(1,1,0) E3=(1,-1,0) E4=(0,3,0) E5=(-3,0,0) E6=(0,-3,0) where the z component is 0, since all edges are in the xy plane. V1 =(0,0,0) V2=(1,0,0) V3=(2,1,0) V4=(3,0,0) V5=(3,3,0) V6=(0,3,0) 12

So the vectors cross products are: E1 X E2 =(0,0,1) E2 X E3 =(0,0,-2) E3 X E4 =(0,0,2) E4 X E5 =(0,0,9) E5 X E6 =(0,0,9) E6 X E1=(0,0,2) Where V1 X V2= (V 1y V 2z -V 1z V 2y, V 1z V 2x -V 1x V 2z, V 1x V 2y -V 1y V 2x ). As shown at E2 the value is negative, so we split the polygon at E2. 13

Another methods to split the polygon is to use the rotational method. We shift the position of the polygon so that each vertex V k in turn is at the coordinate origin. Then, we rotate the polygon in clockwise direction so the next point V k+1 is on the x axis. If the next vertex V k+2 is below the x axis, the polygon is a concave. we then split the polygon along the x axis to form two new polygons. 14

15

16

17