Introduction to Computer Graphics Chapter 6 – 2D Viewing Pt 3 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.
Line clipping: Line clipping algorithm is method of eliminate lines of outside area of the object,so outside of object viewing is Removed. Typically, any.
CHAPTER 12 Height Maps, Hidden Surface Removal, Clipping and Level of Detail Algorithms © 2008 Cengage Learning EMEA.
CS 551 / 645: Introductory Computer Graphics Clipping Lines and Polygons.
Computer Graphics, KKU. Lecture 81 Clipping on a Raster Display.
Dr. Scott Schaefer Clipping Lines. 2/94 Why Clip? We do not want to waste time drawing objects that are outside of viewing window (or clipping window)
Course Website: Computer Graphics 4: Viewing In 2D.
1 Clipping. 2 Transformation Sequence X Y Z X Y Z X Y Z X Y Z Object Coords. Eye Coords. Clip Coords. Normalized Device Coords. Screen Coords. Implementation:
Two-Dimensional Viewing Jehee Lee Seoul National University.
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.
CHAPTER 7 2D VIEWING CGMB214: Introduction to Computer Graphics.
Vertices and Fragments I CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
Course Website: Computer Graphics 9: Clipping In 3D.
1 CSCE 441 Computer Graphics: Clipping Lines Jinxiang Chai.
Computer Graphics Clipping Cohen Sutherland Algorithm (Line) Cyrus-Back Algorithm (Line) Sutherland-Hodgeman Algorithm (Polygon) Cohen Sutherland Algorithm.
1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Clipping.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Implementation I Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
1 Computer Graphics Assistant Professor Dr. Sana’a Wafa Al-Sayegh 2 nd Semester ITGD3107 University of Palestine.
2-Dimension Viewing and Clipping
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.
October 14, 2014Computer Vision Lecture 11: Image Segmentation I 1Contours How should we represent contours? A good contour representation should meet.
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.
CS 325 Introduction to Computer Graphics 03 / 08 / 2010 Instructor: Michael Eckmann.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Objectives Introduce basic implementation strategies Clipping Scan conversion.
CS 480/680 Computer Graphics Shading in OpenGL Dr. Frederick C Harris, Jr. Fall 2013.
2 DIMENSIONAL VIEWING Ceng 477 Introduction to Computer Graphics Fall Computer Engineering METU.
Windows, Viewports, and Clipping
EEL Introduction to Computer Graphics
1Computer Graphics Implementation 1 Lecture 15 John Shearer Culture Lab – space 2
2D Viewing.
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.
CS 376 Introduction to Computer Graphics 02 / 14 / 2007 Instructor: Michael Eckmann.
How many …?. What shape can you see? I can see some _____. Q1 Q1 stars.
Computer Graphics Viewing. 2 of 30 Viewing in 2D Window in world coordinates. 45  250  Viewport in Device coords 250 x 250 Pixels.
Lecture 9 From Vertices to Fragments. Objectives Introduce basic implementation strategies Clipping Rasterization hidden-surface removal.
CS552: Computer Graphics Lecture 12: 3D Clipping.
Two-Dimensional Viewing Hearn & Baker Chapter 6
Computer Graphics Lecture 14 CLIPPING I Taqdees A. Siddiqi
Computer Graphics Clipping.
Introduction to Computer Graphics with WebGL
Computer Graphics CC416 Week 13 Clipping.
Transformations contd.
Computer Graphics Shading in OpenGL
CSCE 441 Computer Graphics: Clipping Polygons Jinxiang Chai
2D Viewing & Clipping 한신대 류승택
Concepts, algorithms for clipping
Implementation I Ed Angel
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
Segment Clipping Simple algorithm. For each segment compute the intersection with the four sides of the rectangle, and then determine which sub-segment.
Computer Graphics Viewing. 2 of 30 Viewing in 2D Window in world coordinates. 45  250  Viewport in Device coords 250 x 250 Pixels.
Implementation I Ed Angel Professor Emeritus of Computer Science
COMPUTER GRAPHICS Clipping
Presentation transcript:

Introduction to Computer Graphics Chapter 6 – 2D Viewing Pt 3 1

2 Nicholl-Lee-Nicholl Line Clipping (NLN)  Creating more regions around the clip window to avoid multiple clipping of an individual line segment.  Different to Cohen where Cohen require multiple calculation along the path of a single line before an intersection on the clipping rectangle is locate or completely rejected.  NLN eliminate extra calculations through new region created.

3 Nicholl-Lee-Nicholl Line Clipping (NLN) Compared to Cohen and Liang; NLN perform fever comparisons and division. The trade-off is that NLN can only be applied two two-dimensional clipping only.

4 Nicholl-Lee-Nicholl Line Clipping (NLN) How its work? First, need to determine the endpoints P 1 and P 2 from the possible nine regions. Out of nine, NLN only interested on three regions. If P 1 lies in any one of other six regions, symmetry transformation will be applied first. Then, is to determine where P 2 is. If P 1 is inside and P 2 is outside we will follow the first case where intersection with appropriate window boundary is carried out. Four regions of L,T,R,B which contains P 2 are introduced. If P 1 and P 2 are inside the clipping rectangle, we save the entire line.

5 L NLN (2,2)(6,2) (6,6) (2,6) P1 (1,4) LT LR LB P2 (6,7)

6 NLN For example when P 2 is in region LT if Slope P 1 P TR < Slope P 1 P 2 < Slope P 1 P TL Or (Y T - Y 1 )/(X R – X 1) ) < (Y 2 - Y 1 )/(X 2 – X 1 ) < (Y T – Y 1 )/(X L – X 1 ) Ex: (6-4)/(6-1) < (7-4)/(6-1) < (6-4)/(2-1) 2/5 < 3/5 < 2 And we clip the entire line if (Y T – Y 1 )(X 2 – X 1 ) < (X L – X 1 )(Y 2 – Y 1 )

7 NLN From the parametric equations: x = x 1 + (x 2 – x 1 )u y = y 1 + (y 2 – y1)u An intersection position on the left boundary is x = x L with u = (x L – x 1 )/(x 2 – x 1 ) will give coordinate y = y 1 +((y 2 – y 1 )/(x 2 – x 1 )) * (x L – x 1 ) An intersection position on the top boundary has y = y T with u = (y T – y 1 )/(y 2 – y 1) will give coordinate x = x 1 +((x 2 – x 1 )/(y 2 – y 1 )) * (y T – y 1 )

8 Line Clipping Using Nonrectangular Clip Windows Some applications clip lines against arbitrarily shaped polygons. Liang and Cyrus-Beck algorithm can be extended to convex polygon windows. For concave polygon-clipping regions, we need to split the concave polygon into set of convex polygons. Circles or other curved-boundary clipping regions are also possible but slower because intersection calculations involve nonlinear curve equation. Line can be identified as completely inside if the distance for both endpoints of a line is less than or equal to the radius squared. If not, then intersection calculation is performed.