Clipping. Before clipping… After clipping… Point Clipping Display P = (x, y) if xw min <= x <= xw max yw min <= y <= yw max.

Slides:



Advertisements
Similar presentations
Computer Graphics 4: Viewing In 2D
Advertisements

Computer Graphics Inf4/MSc 1 Computer Graphics Lecture 7 Scanline algorithm and polygon clipping Taku Komura.
Rezanje črt in poligonov. World window & viewport window viewport screen window world window.
I N T R O D U C T I O N T O C O M P U T E R G R A P H I C S Andries van Dam September 30, D Clipping 1/14 Clipping (pages , )
Computer Graphics CLIPPING.
3D Clipping & Viewing process
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.
Java ThreadsGraphics Programming Graphics Programming: Windows, Viewports & Clipping.
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:
Line Clipping Algorithms. A Cases for Clipping Lines E B H C G J I clip rectangle 2Prepared by Narendra V G CSE MIT.
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,
2D Viewing and Projection
Introduction to Computer Graphics Chapter 6 – 2D Viewing Pt 2 1.
CHAPTER 7 2D VIEWING CGMB214: Introduction to Computer Graphics.
Informationsteknologi Thursday, November 22, 2007Computer Graphics - Class 111 Today’s class Clipping Parametric and point-normal form of lines Intersecting.
Vertices and Fragments I CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
1 Computer Graphics Chapter 4 2D Viewing Algorithms.
1 CSCE 441 Computer Graphics: Clipping Lines Jinxiang Chai.
CS 376 Introduction to Computer Graphics 02 / 26 / 2007 Instructor: Michael Eckmann.
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.
University College Dublin1 Clipping u Clipping is the removal of all objects or part of objects in a modelled scene that are outside the real-world window.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Implementation I Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
2D Viewing. 2D viewing transformation is a mapping of world coordinate scene to device coordinates xw min xw max yw min yw max xv min xv max yv min yv.
Graphics Pipeline Clipping CMSC 435/634. Graphics Pipeline Object-order approach to rendering Sequence of operations – Vertex processing – Transforms.
Clipping: Clipping is a process of dividing an object into visible and invisible positions and displaying the visible portion and discarding the invisible.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
CS 480/680 Computer Graphics Shading in OpenGL Dr. Frederick C Harris, Jr. Fall 2013.
Clipping CSCI 440 textbook section Starter Question How do we clip these lines? X=-5 Y=-5 Y=5 X=5 [0,0] [3,3] [7,-3] [0,-3] formula from wikipedia.
CSE Real Time Rendering Week 9. Post Geometry Shaders Courtesy: E. Angel and D. Shreiner – Interactive Computer Graphics 6E © Addison-Wesley 2012.
Clipping Computer Graphics Cohen Sutherland Algorithm (Line)
Windows, Viewports, and Clipping
Unit – IV 2D Viewing. 2 of 30 Contents Windowing Concepts The viewing pipeline viewing coordinate reference frame, window to view-port coordinate transformation,
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.
Computer Graphics Lecture 20 Fasih ur Rehman. Last Class Clipping – What is clipping – Why we do clipping – How clipping is done.
1Computer Graphics Implementation 1 Lecture 15 John Shearer Culture Lab – space 2
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.
A.Aruna/Assistant Professor/SNSCE
Perspective View Volume View Volume Far Near Window Far Near Window Center of Projection Center of Projection (a) Original Orientation (b) After Transformation.
Computer Graphics Viewing. 2 of 30 Viewing in 2D Window in world coordinates. 45  250  Viewport in Device coords 250 x 250 Pixels.
Clipping.
Computer Graphics Lecture 14 CLIPPING I Taqdees A. Siddiqi
Computer Graphic 2 D Viewing.
Computer Graphics Clipping.
Introduction to Computer Graphics with WebGL
Computer Graphics CC416 Week 13 Clipping.
CSCE 441 Computer Graphics: Clipping Polygons Jinxiang Chai
2D Viewing & Clipping 한신대 류승택
Concepts, algorithms for clipping
3D Clipping.
Graphics Pipeline Clipping
Computer Graphics 9: Clipping In 3D
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
Lecture 13 Clipping & Scan Conversion
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
CS U540 Computer Graphics Prof. Harriet Fell Spring 2007
Computer Graphics Viewing. 2 of 30 Viewing in 2D Window in world coordinates. 45  250  Viewport in Device coords 250 x 250 Pixels.
Type to enter a caption. Computer Graphics Week 4 Lecture 2.
CS U540 Computer Graphics Prof. Harriet Fell Spring 2007
Presentation transcript:

Clipping

Before clipping…

After clipping…

Point Clipping Display P = (x, y) if xw min <= x <= xw max yw min <= y <= yw max

Line Clipping Display P = (x, y) if xw min <= x <= xw max yw min <= y <= yw max Line Clipping If both points lie inside the window display segment

Line Clipping (cont) Display P = (x, y) if xw min <= x <= xw max yw min <= y <= yw max Line Clipping If both points lie inside the window display segment If both points lie outside the same boundary discard segment

Line Clipping (cont) Display P = (x, y) if xw min <= x <= xw max yw min <= y <= yw max If both points lie inside the window display segment If both points lie outside the same boundary discard segment If segment crosses one or more boundaries calculate intersections with boundaries x = x 1 + u(x 2 - x 1 ) y = y 1 + u(y 2 - y 1 ) if 0 <= u <= 1 display section within boundary else discard segment

Cohen - Sutherland Line Clipping 4 bit clip code: A B R L

Cohen - Sutherland Line Clipping (cont) 4 bit clip code: A B R L A = y > yw max B = y < yw min R = x > xw max L = x < xw min

4 bit clip code: A B R L A = y > yw max B = y < yw min R = x > xw max L = x < xw min Calculate clip code P 1 = P 2 = => accept segment P 1 P 2 (trivial accept since both end points are in the window

4 bit clip code: A B R L A = y > yw max B = y < yw min R = x > xw max L = x < xw min Calculate clip code P3 = P4 = => Reject segment P3 P4