Type to enter a caption. Computer Graphics Week 5 Lecture 1.

Slides:



Advertisements
Similar presentations
Rezanje črt in poligonov. World window & viewport window viewport screen window world window.
Advertisements

Computer Graphics CLIPPING.
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.
Course Website: Computer Graphics 4: Viewing In 2D.
Computer Graphics : Clipping
Computer Graphics Viewing.
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,
Introduction to Computer Graphics Chapter 6 – 2D Viewing Pt 2 1.
Computer Graphics Clipping Cohen Sutherland Algorithm (Line) Cyrus-Back Algorithm (Line) Sutherland-Hodgeman Algorithm (Polygon) Cohen Sutherland Algorithm.
Graphics Pipeline Clipping CMSC 435/634. Graphics Pipeline Object-order approach to rendering Sequence of operations – Vertex processing – Transforms.
1 Computer Graphics Assistant Professor Dr. Sana’a Wafa Al-Sayegh 2 nd Semester ITGD3107 University of Palestine.
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.
Two-Dimensional Viewing
Clipping: Clipping is a process of dividing an object into visible and invisible positions and displaying the visible portion and discarding the invisible.
Part 6: Graphics Output Primitives (4) 1.  Another useful construct,besides points, straight line segments, and curves for describing components of a.
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?
1 Computer Graphics Clipping Fall FCC Line Clipping What happens when one or both endpoints of a line segment are not inside the specified drawing.
1Computer Graphics Implementation 1 Lecture 15 John Shearer Culture Lab – space 2
COMPUTATIONAL GEOMETRY AND MATRIX MULTIPLICATION Mohammed Zeeshan Farooqui Minhaj Uddin.
Introduction to Computer Graphics Chapter 6 – 2D Viewing Pt 3 1.
CS6234 Advanced Algorithms - Convex hull. Terminologies – ◦ Convex hull of a set Q of points is the smallest convex polygon P for which each point in.
Lecture 15: Raster Graphics and Scan Conversion
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.
Clipping. Before clipping… After clipping… Point Clipping Display P = (x, y) if xw min
Ta: Ryan Freedman Sushma Kini Chi Zhou.  Pipeline  Clipping  Transformation, homogeneous coordinates  Lighting  Perspective  Viewing.
CS 376 Introduction to Computer Graphics 02 / 14 / 2007 Instructor: Michael Eckmann.
Computer Graphics Lecture 08 Taqdees A. Siddiqi Computer Graphics Filled Area Primitives I Lecture 08 Taqdees A. Siddiqi
Computer Graphics Through OpenGL: From Theory to Experiments, Second Edition Chapter 14.
Clipping.
Two-Dimensional Viewing Hearn & Baker Chapter 6
Computer Graphics Lecture 14 CLIPPING I Taqdees A. Siddiqi
Computer Graphic 2 D Viewing.
Computer Graphics Clipping.
Computer Graphics Filling.
Computer Graphics CC416 Week 13 Clipping.
Transformations contd.
Computer Graphics Filled Area Primitives II Lecture 09 Taqdees A
CSCE 441 Computer Graphics: Clipping Polygons Jinxiang Chai
Concepts, algorithms for clipping
Graphics Pipeline Clipping
Chapter 7 2D Clipping.
WINDOWING AND CLIPPING
Computer Graphics : Viewing In 2D
Clipping Computer Graphics Cohen Sutherland Algorithm (Line)
CSCE 441 Computer Graphics: Clipping Lines Jinxiang Chai
CSCE 441 Computer Graphics: Clipping Polygons Jinxiang Chai
CSCE 441 Computer Graphics: Clipping Lines Jinxiang Chai
WINDOWING AND CLIPPING
Lecture 13 Clipping & Scan Conversion
CSCE 441 Computer Graphics: Clipping Polygons Jinxiang Chai
Two Dimensional Viewing and Clipping.
Segment Clipping Simple algorithm. For each segment compute the intersection with the four sides of the rectangle, and then determine which sub-segment.
CS U540 Computer Graphics Prof. Harriet Fell Spring 2007
Clipping Polygons Dr. Scott Schaefer.
Clipping Clipping Sutherland-Hodgman Clipping
CS U540 Computer Graphics Prof. Harriet Fell Spring 2007
Type to enter a caption. Computer Graphics Week 4 Lecture 2.
Computational Geometry Algorithms
Clipping University of British Columbia CPSC 314 Computer Graphics
Type to enter a caption. Computer Graphics Week 3 Lecture 1.
Type to enter a caption. Computer Graphics Week 6 Lecture 1.
CS U540 Computer Graphics Prof. Harriet Fell Spring 2007
Clipping Polygons Lecture 31 Fri, Nov 9, 2007.
Type to enter a caption. Computer Graphics Week 10 Lecture 2.
COMPUTER GRAPHICS Clipping
Presentation transcript:

Type to enter a caption. Computer Graphics Week 5 Lecture 1

Polygon Clipping

Polygon Basics Convex Polygon Non Convex Polygon A line joining any two interior points lie completely inside the polygon A line joining any two interior points does not lie completely inside the polygon

Polygon Basics Postively Oriented Polygon: If the tour of vertices in the given order produces a counter clockwise circuit e.g. ABCDE → +vely oriented AEDCB → not +vely oriented

Mathematical defination of +ve orientation NOTE: If we tour along the edges of +vely oriented polygon our left hand would always point towards the inside of the polygon Let A(x1,y1) and B(x2,y2) be a directed line segment, Then a point P(x,y) will be to the left of line segment if C = (x2-x1)(y-y1) - (y2-y1)(x-x1) is +ve

Mathematical defination of Convex Polygon So if a point P(x,y) , that lies inside the polygon, is to the right of any edge , then the polygon is not Convex polygon (Given positive orientation)

Sutherland Hodgeman Algo For Clipping any polygon against a convex clipping window Successively , clips the polygon against the infinite edges of clipping window

S-H Algo Input : Vertices of polygon to be clipped (v1,v2, … , vn) Output : Produces a clipped polygon by introducing new vertices at places where the polygon gets clipped. Algo: The algo starts from the edge vn to v1, moves around the edges of polygon until it reaches back to vn. At each step , it examines the relationship between the polygon edge and the clipping boundary. Based on the relationship , adds zero,one or two vertices to the list of output vertices (that will define the clipped polygon) Explanation on board

SO, There could be 4 cases based on how polygon edge crosses the clipping boundary

Case: Both Vertices, of polygon edge (v1 and v2) , are inside the clipping boundary Output: Add v2 to output list Case 1

Case 2 Case: v1 is inside v2 is outside Output: Intersection point of polygon edge with the clipping boundary , i , is output Case 2

Case: Both v1 and v2 are outside Output: no output Case 3

Case: v1 is outside and v2 is inside Output: i and v2 Case 4

Example

Left Edge Clipping Input vertices : v1 to v8 Output vertices: i1,i2,v8,v7,v6,v5,v4,v3,v2

Bottom Edge Clipping Input vertices : i1,i2,v8,v7,v6,v5,v4,v3,v2 Output vertices: i2,v8,i3,i4,v6,v5,v4,v3,v2,i1

Right Edge Clipping Input vertices : i2,v8,i3,i4,v6,v5,v4,v3,v2,i1 Output vertices: i5,i6,v4,v3,v2,i1,i2,v8,i3,i4,v6

Top Edge Clipping Input vertices : i5,i6,v4,v3,v2,i1,i2,v8,i3,i4,v6 Output vertices: i7,i8,v2,i1,i2,v8,i3,i4,v6,i5,i6,v4

The End

Slide 1

Text

Text