Clipping Polygons Lecture 31 Fri, Nov 9, 2007.

Slides:



Advertisements
Similar presentations
1. Find the cost of each of the following using the Nearest Neighbor Algorithm. a)Start at Vertex M.
Advertisements

Objectives Define Clipping Various clipping methods. Line clipping methods.
Computer Graphics Scan Conversion Polygon Faculty of Physical and Basic Education Computer Science Dep Lecturer: Azhee W. MD.
10/10/02 (c) 2002 University of Wisconsin, CS 559 Last Time Finished viewing: Now you know how to: –Define a region of space that you wish to view – the.
Computer Graphics, KKU. Lecture 81 Clipping on a Raster Display.
Line Clipping Algorithms. A Cases for Clipping Lines E B H C G J I clip rectangle 2Prepared by Narendra V G CSE MIT.
Clipping CSE 403 Computer Graphics Cohen Sutherland Algorithm (Line)
Viewing & Clipping In 2D. 2 of 44 Contents Windowing Concepts Clipping –Introduction –Brute Force –Cohen-Sutherland Clipping Algorithm Area Clipping –Sutherland-Hodgman.
CMPE 466 COMPUTER GRAPHICS Chapter 8 2D Viewing Instructor: D. Arifler Material based on - Computer Graphics with OpenGL ®, Fourth Edition by Donald Hearn,
Geometry Chapter Polygons. Convex Polygon – a polygon with a line containing a side with a point in the interior of the polygon.
Lesson 1.6 Classify Polygons. Objective Classify Polygons.
6/2/ :35 AMIncremental Convex Hull1 q w u e zt.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Interpolation Clipping.
Vertices and Fragments I CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
Rasterization May 14, Triangles Only We will discuss the rasterization of triangles only. Why? –Polygon can be decomposed into triangles. –A triangle.
1 CSCE 441 Computer Graphics: Clipping Lines Jinxiang Chai.
6.1 Vis_04 Data Visualization Lecture 6 - A Rough Guide to Rendering.
©Larry F. Hodges (modified by Amos Johnson) 1 Shading Models.
Graphics Pipeline Clipping CMSC 435/634. Graphics Pipeline Object-order approach to rendering Sequence of operations – Vertex processing – Transforms.
Textures – Magnification and Minification Lecture 30 Mon, Nov 17, 2003.
Clipping Apart from clipping to the view volume, clipping is a basic operation in many other algorithms –Breaking space up into chunks –2D drawing and.
CS 376 Introduction to Computer Graphics 02 / 12 / 2007 Instructor: Michael Eckmann.
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.
CS 480/680 Computer Graphics Shading in OpenGL Dr. Frederick C Harris, Jr. Fall 2013.
Warm Up Week 1. Section 6.1 Day 1 I will identify, name, and describe polygons. Ex 1 PolygonHas three or more sides that connect at endpoints.
Lesson 8.2 (Part 2) Exterior Angles in Polygons
Geometry Section 8.1 Find Angle Measures in Polygons.
Scan Conversion. Last step in the graphics pipeline Efficiency is a central issue Common primitives – Lines (done last class) – Polygons (fill polygons,
1 Visiblity: Culling and Clipping Computer Graphics COMP 770 (236) Spring 2009 January 21 & 26: 2009.
8.1 Classifying Polygons. Polygon Review  Characteristics of a Polygon All sides are lines Closed figure No side intersects more than 1 other side at.
Soham Uday Mehta. Linear Programming in 3 variables.
Implementation of a Renderer Consider Programs are processd by the system line & polygon, outside the view volume Efficiently Understanding of the implementation.
Geometry Section 1.6 Classifying Polygons. Terms Polygon-closed plane figure with the following properties Formed by 3 or more line segments called sides.
1Computer Graphics Implementation 1 Lecture 15 John Shearer Culture Lab – space 2
Do Now. Section 8.2 Angles in Polygons Polygon Interior Angles Theorem The sum of the measures of the interior angles of a convex polygon with n sides.
2D Viewing.
Chapter 4 Vector Tools for Graphics. Vectors – The Basics Lecture 11 Fri, Sep 19, 2003.
Clipping Primitives. Clipping line Clipping rectangle: – x min to x max – y min to y max A point (x,y) lies within a clip rectangle and thus displayed.
Graphics Graphics & Graphical Programming Lecture 23 - Viewing & Clipping.
Introduction to Meshes Lecture 22 Mon, Oct 20, 2003.
Textures – Basic Principles Lecture 29 Fri, Nov 14, 2003.
2 3D Viewing Process  3D viewing process MC Model Space Model Transformation Model Transformation WC World Space Viewing Transformation Viewing Transformation.
Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 14.
Polygons. Polygon Interior Angle Theorem The sum of the measures of the interior angles of a convex polygon is given by: Sum = 180(n – 2) where n represents.
CS552: Computer Graphics Lecture 12: 3D Clipping.
Computer Graphics Clipping.
Computer Graphics CC416 Week 13 Clipping.
Computer Graphics Shading in OpenGL
Shadows Depth Map shadows Raytrace shadows.
3-5 Angles of a Polygon.
Graphics Pipeline Clipping
CSC461: Lecture 23 Shading Computation
Rasterizing Lines 2 Lecture 33 Wed, Nov 14, 2007.
AMS 345/CSE 355 Computational Geometry
A closed plane figure with at least 3 sides.
CSCE 441 Computer Graphics: Clipping Lines Jinxiang Chai
Lecture 13 Clipping & Scan Conversion
CSCE 441 Computer Graphics: Clipping Polygons Jinxiang Chai
Introduction to Meshes
8.1 Find Angle Measures in Polygons
Chapter 6 Section 6.1 Polygons.
Shading Polygons Lecture 36 Wed, Nov 28, 2007.
Rasterizing Polygons 2 Lecture 35 Mon, Nov 26, 2007.
CS U540 Computer Graphics Prof. Harriet Fell Spring 2007
2- and 3-Dimensional Figures
Rasterizing Polygons Lecture 29 Wed, Dec 7, 2005.
CS U540 Computer Graphics Prof. Harriet Fell Spring 2007
Type to enter a caption. Computer Graphics Week 5 Lecture 1.
CS U540 Computer Graphics Prof. Harriet Fell Spring 2007
Introduction to Meshes
Presentation transcript:

Clipping Polygons Lecture 31 Fri, Nov 9, 2007

Clipping Polygons Clipping polygons requires that their edges be clipping by the line-clipping algorithm, and then new edges be created. Keep in mind that OpenGL treats all polygons as though they were convex. How does this make clipping more efficient?

Clipping Polygons Clip region Polygon

Clipping Polygons Clip the top edge.

Clipping Polygons Clip the top edge.

Clipping Polygons Clip the top edge.

Clipping Polygons Clip the right edge.

Clipping Polygons Clip the right edge.

Clipping Polygons Clip the right edge.

Clipping Polygons Clip the bottom edge.

Clipping Polygons Clip the bottom edge.

Clipping Polygons Clip the bottom edge.

Clipping Polygons Clip the left edge.

Clipping Polygons Clip the left edge.

Clipping Polygons Clip the left edge.

Clipping Polygons The clipped polygon.

Clipping Polygons When an edge is clipped, a shade and a normal are assigned to the new vertex by interpolating between the endpoints. These interpolated shades and normals are used when the interior of the polygon is shaded.

Interpolating the Clipped Polygon [1, 1, 0] (2, 4) 3 (-6, 0) [1, 0, 0] [0, 1, 0] (5, -2) (-5, -2) [0, 0, 1] -3 -4 4

Interpolating the Clipped Polygon [1, 1, 0] (2, 4) 3 (-6, 0) [1, 0, 0] [0, 1, 0] (5, -2) (-5, -2) [0, 0, 1] -3 -4 4

Interpolating the Clipped Polygon [1, 1, 0] (2, 4) 3 (-6, 0) [1, 0, 0] [0, 1, 0] (5, -2) (-5, -2) [0, 0, 1] -3 -4 4

Interpolating the Clipped Polygon [1, 1, 0] (2, 4) (0, 3) 3 (-4, 1) (-6, 0) (4, 0) [1, 0, 0] [0, 1, 0] (5, -2) (-5, -2) (-4, -2) (4, -2) [0, 0, 1] -3 -4 4

Interpolating the Clipped Polygon [1, 1, 0] [1, 0.75, 0] (2, 4) (0, 3) 3 [1, 0.25, 0] (-4, 1) [0.33, 1, 0] (-6, 0) (4, 0) [1, 0, 0] [0, 1, 0] (5, -2) (-5, -2) (-4, -2) [0, 0.1, 0.9] (4, -2) [0, 0, 1] -3 [0, 0.9, 0.1] -4 4

Interpolating the Clipped Polygon [1, 0.75, 0] [0.83, 1, 0] (0, 3) (2.5, 3) 3 [1, 0.25, 0] (-4, 1) [0.33, 1, 0] (4, 0) (-4, -2) [0, 0.1, 0.9] (4, -2) -3 [0, 0.9, 0.1] -4 4

Interpolating the Clipped Polygon [1, 0.75, 0] [0.83, 1, 0] (0, 3) (2.5, 3) 3 [1, 0.25, 0] (-4, 1) [0.33, 1, 0] (4, 0) (-4, -2) [0, 0.1, 0.9] (4, -2) -3 [0, 0.9, 0.1] -4 4