Computer Graphics- SCC 342

Slides:



Advertisements
Similar presentations
Visible-Surface Detection(identification)
Advertisements

By D. Fisher Geometric Transformations. Reflection, Rotation, or Translation 1.
0 - 0.
DIVIDING INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
ADDING INTEGERS 1. POS. + POS. = POS. 2. NEG. + NEG. = NEG. 3. POS. + NEG. OR NEG. + POS. SUBTRACT TAKE SIGN OF BIGGER ABSOLUTE VALUE.
MULT. INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
Addition Facts
Polygon Scan Conversion – 11b
SI23 Introduction to Computer Graphics
GR2 Advanced Computer Graphics AGR
8.1si31_2001 SI31 Advanced Computer Graphics AGR Lecture 8 Polygon Rendering.
Reconstruction from Voxels (GATE-540)
Addition 1’s to 20.
Week 1.
COMP 175 | COMPUTER GRAPHICS Remco Chang1/6103b – Shapes Lecture 03b: Shapes COMP 175: Computer Graphics February 3, 2015.
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.
In the name of God Computer Graphics Bastanfard.
CMPE 466 COMPUTER GRAPHICS Chapter 8 2D Viewing Instructor: D. Arifler Material based on - Computer Graphics with OpenGL ®, Fourth Edition by Donald Hearn,
Chapter 6 Polygons. A polygon is a closed plane figure formed by three or more segments that intersect only at their endpoints. PolygonsNot Polygons.
Informationsteknologi Wednesday, November 7, 2007Computer Graphics - Class 51 Today’s class Geometric objects and transformations.
CS 450: Computer Graphics OVERVIEW OF POLYGONS
Different types of Polygons Simple Convex Simple Concave Non-simple : self-intersecting With holes ConvexConcaveSelf-intersecting.
Output Primitives Computer Graphics.
Graphics Output Primitives Pixel Addressing and Fill Area Dr. M. Al-Mulhem Feb. 1, 2008.
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.
Computer Graphics- SCC 342
CS-321 Dr. Mark L. Hornick 1 3-D Object Modeling.
CS 450: Computer Graphics REVIEW: OVERVIEW OF POLYGONS
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
Part 6: Graphics Output Primitives (4) 1.  Another useful construct,besides points, straight line segments, and curves for describing components of a.
CS 480/680 Computer Graphics Implementation III Dr. Frederick C Harris, Jr. Fall 2011.
2D Output Primitives Points Lines Circles Ellipses Other curves Filling areas Text Patterns Polymarkers.
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.
Computer Graphics Chapter 6 Andreas Savva. 2 Interactive Graphics Graphics provides one of the most natural means of communicating with a computer. Interactive.
CS 325 Introduction to Computer Graphics 03 / 29 / 2010 Instructor: Michael Eckmann.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
1 11. Polygons Polygons 2D polygons ( 다각형 ) –Polygon sides are all straight lines lying in the same plane 3D polyhedra ( 다면체 )  chap. 12 –Polyhedra.
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.
CS COMPUTER GRAPHICS LABORATORY. LIST OF EXPERIMENTS 1.Implementation of Bresenhams Algorithm – Line, Circle, Ellipse. 2.Implementation of Line,
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.
Geometry Section 1.6 Classifying Polygons. Terms Polygon-closed plane figure with the following properties Formed by 3 or more line segments called sides.
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.
11 Chapter Introductory Geometry
OUTPUT PRIMITIVES A.Aruna/Faculty of Information technology/SNSCE13/19/2016.
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
3D Object Representations. Introduction Line and circle and polygon algorithms- represented simple and smooth object. Some Natural object are neither.
Computer Graphics CC416 Lecture 04: Bresenham Line Algorithm & Mid-point circle algorithm Dr. Manal Helal – Fall 2014.
3D Ojbects: Transformations and Modeling. Matrix Operations Matrices have dimensions: Vectors can be thought of as matrices: v=[2,3,4,1] is a 1x4 matrix.
Computer Graphics I, Fall 2010 Scan conversion algorithms.
Lecture 5 Basic geometric objects
Computer Graphics Filling.
Photorealistic Rendering vs. Interactive 3D Graphics
Introduction to Polygons
Computer Graphics Filled Area Primitives II Lecture 09 Taqdees A
Implementation III.
Fill Area Algorithms Jan
Polygon Filling Algorithms
11 Chapter Introductory Geometry
Computer Graphics Implementation III
Three-Dimensional Object Representation
Chapter 3 Graphics Output Primitives
Primitive Drawing Algorithm
Primitive Drawing Algorithm
Polygons.
Presentation transcript:

Computer Graphics- SCC 342 Chapter 4: Graphics Output Primitives Dr. Doaa Hegazy

2D Graphics Primitives Graphics drawing is based on basic geometric structures called graphics primitives Points Lines Circles Conic Sections

4.1 Coordinate Reference Frames To describe a picture, first decide upon a convenient Cartesian coordinate system, called the world-coordinate reference frame WCR can be 2D or 3D Objects in pictures described by: positions in world coordinates Color coordinate extents = the minimum and maximum x, y, and z values for each object

4.1 Coordinate Reference Frames Screen Coordinates Locations on a video monitor are referenced in integer screen coordinates, which correspond to the pixel positions in the frame buffer Pixel coordinate values give the scan line number (the y value) and the column number (the x value along a scan line) Scan-line algorithms for the graphics primitives use the defining coordinate descriptions to determine the locations of pixels that are to be displayed

4.1 Coordinate Reference Frames Screen Coordinates For the present, we assume that each integer screen position references the center of a pixel area

4.1 Coordinate Reference Frames Absolute and Relative Coordinate Specifications Absolute coordinate values: the values specified are the actual positions within the coordinate system in use Relative coordinates: we can specify a coordinate position as an offset from the last position that was referenced (called the current position)

4.6 File Area Primitives Another useful component beside geometric objects is describing an area with filled color Referred to as fill area or filled area Most graphics routins require the fill area to specified as polygon - their boundries are described by linear equations. - most surface can be approximated by polygons (called surface tessellation)

4.7 Polygon Fill Area Polygons: plane figure specified by three or more vertices and connected by edges Has all vertices within plane- no edge crossing Polygon classification: - Convex: interior angle = or less than 180 degrees - Concave: interior angle greater than 180 degrees Implementations for filling algorithms are complicated for concave polygons convex concave

4.7 Polygon Fill Area Identifying concave polygons - extension of some edges will intersect other edges - take a look at the polygon vertex positions relative to the extension line of any edge: some vertices are on one side and some are on the other

4.7 Polygon Fill Area Splitting concave polygons Split concave polygons into a set of convex polygons Using edge vectors and edge cross products Use vertex position relative to edge extension line.

4.7 Polygon Fill Area Splitting concave polygons Assume all polygons in xy plane Ek = Vk+1 – Vk Calculate cross product of successive edge vectors - if at least z component of one vector is negative, then concave polygon. - no successive vertices are collinear. Split along the line of the first edge vector in the cross product pair.

4.7 Polygon Fill Area Splitting concave polygons

4.7 Polygon Fill Area Splitting concave polygons

4.7 Polygon Fill Area Splitting concave polygons Another method is a rotational method

4.7 Polygon Fill Area Splitting convex polygons into triangle (tessellation) - define any sequence of three consecutive vertices to a triangle. - delete middle vertex from the original list - continue forming triangle - stop when only three vertices are remaining.

4.7 Polygon Fill Area Inside-Outside test Also called odd-even test P Q

4.7 Polygon Fill Area Winding-Number test Count counterclockwise encirclements of point P Q

4.7 Polygon Fill Area Polygon tables objects in a scene are described as sets of polygon surface facets Object description includes: - Coordinate information (geometry for the polygon facets) - Surface parameters(color, transparency, and light-reflection properties) Object information are organized in tables.

4.7 Polygon Fill Area Polygon tables

4.7 Polygon Fill Area Polygon tables Important for check for consistency and completeness: 1. each pixel is an end point for at least two edges. 2. every edge is part of at least one polygon 3. every polygon is closed 4. each polygon has at least one shared edge