Many slides are borrowed from Foley & Van Dam. Topics Viewing Transformation Pipeline in 2D Line and polygon clipping (Slow Fast) – Simultaneous Equations.

Slides:



Advertisements
Similar presentations
Computer Graphics - Rasterization -
Advertisements

Clipping de linhas e polígonos. Casos de clipping de linhas.
Clipping Covers chapter 10 of Computer Graphics and Virtual Environments (Slater, Steed and Chrysanthou) . See ©Yiorgos Chrysanthou.
9.1 Si23_03 SI23 Introduction to Computer Graphics Lecture 9 – Clipping.
Computer Graphics 4: Viewing In 2D
CS123 | INTRODUCTION TO COMPUTER GRAPHICS Andries van Dam © Clipping Concepts, Algorithms for line clipping 1 of 16 Clipping - 10/16/12.
Computer Graphics Inf4/MSc 1 Computer Graphics Lecture 7 Scanline algorithm and polygon clipping Taku Komura.
UNC Chapel Hill Lin/Foskey/Manocha Steps in DP: Step 1 Think what decision is the “last piece in the puzzle” –Where to place the outermost parentheses.
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 , )
3D Clipping & Viewing process
Objectives Define Clipping Various clipping methods. Line clipping methods.
Computer Graphics Lecture 8 Arbitrary Viewing II: More Projection, Clipping and Mathematics of 3D Viewing.
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.
3/2/04© University of Wisconsin, CS559 Spring 2004 Last Time General Perspective –Methods for specifying the view volume As a set of clip planes As a field.
David Breen, William Regli and Maxim Peysakhov
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)
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:
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.
2D Viewing and Projection
Introduction to Computer Graphics Chapter 6 – 2D Viewing Pt 2 1.
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 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.
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.
Graphics Pipeline Clipping CMSC 435/634. Graphics Pipeline Object-order approach to rendering Sequence of operations – Vertex processing – Transforms.
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.
10/15/02 (c) 2002 University of Wisconsin, CS559 Last Time Clipping.
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)
10/19/04© University of Wisconsin, CS559 Fall 2004 Last Time Clipping –Why we care –Sutherland-Hodgman –Cohen-Sutherland –Intuition for Liang-Barsky Homework.
2D Viewing.
Introduction to Computer Graphics Chapter 6 – 2D Viewing Pt 3 1.
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.
Clipping. Before clipping… After clipping… Point Clipping Display P = (x, y) if xw min
Two-Dimensional Viewing Hearn & Baker Chapter 6
Computer Graphics Lecture 14 CLIPPING I Taqdees A. Siddiqi
Computer Graphics Clipping.
Transformations contd.
CS 551 / 645: Introductory Computer Graphics
Concepts, Algorithms for line clipping
CSCE 441 Computer Graphics: Clipping Polygons Jinxiang Chai
3D rezanje 3D Clipping view frustrum clipping planes clipped.
Concepts, algorithms for clipping
Graphics Pipeline 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
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.
© University of Wisconsin, CS559 Fall 2004
(c) 2002 University of Wisconsin, CS559
3D rezanje 3D Clipping view frustrum clipping planes clipped.
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.
Clipping University of British Columbia CPSC 314 Computer Graphics
CS U540 Computer Graphics Prof. Harriet Fell Spring 2007
COMPUTER GRAPHICS Clipping
Presentation transcript:

Many slides are borrowed from Foley & Van Dam

Topics Viewing Transformation Pipeline in 2D Line and polygon clipping (Slow Fast) – Simultaneous Equations – Cohen-Sutherland Line Clipping Algorithm – Cyrus-Beck / Liang-Barsky Line Clipping Algorithm Sutherland-Hodgman Polygon Clipping

? ?

Line Clipping Endpoints Configuration – Both inside: ? – One in, one out: ? – Both outside: ?

Line Clipping Endpoints Configuration – Both inside: No need for clipping – One in, one out: ? – Both outside: ?

Line Clipping Endpoints Configuration – Both inside: No need for clipping – One in, one out: ? – Both outside: ?

Line Clipping Endpoints Configuration – Both inside: No need for clipping – One in, one out: 1 intersection point – Both outside: ?

Line Clipping Endpoints Configuration – Both inside: No need for clipping – One in, one out: 1 intersection point – Both outside: 2/0 intersection points Is more than 2 intersection points possible? No, intersection of 2 convexes is still a convex.

Simultaneous Equations

Any better algorithm? P1P2Observation Out ? Exterior half plane Possible interior half plane

Any better algorithm? P1P2Observation Out No intersection with the line(reject) In ? Exterior half plane Possible interior half plane

Any better algorithm? P1P2Observation Out No intersection with the line(reject) In No intersection with the line Out/InIn/Out? Exterior half plane Possible interior half plane

Any better algorithm? P1P2Observation Out No intersection with the line(reject) In No intersection with the line Out/InIn/OutOne intersection point with the line Exterior half plane Possible interior half plane

Any better algorithm? P1P2Observation Out No intersection with the line(reject) In No intersection with the line OOne intersection point with the line Exterior half plane Possible interior half plane Same encoding Different encoding

Cohen-Sutherland for Line Clipping For line i from 1 to 4 switch P0.bit[i] &P1.bit[i ] case 11: trivially reject; //outside of the window return; case 00: continue; //no intersection point case 10 or 01: compute intersection point; refresh one endpoint by the intersection point; continue 0 0 1

Cohen-Sutherland for Line Clipping For line i from 1 to 4 switch P0.bit[i] &P1.bit[i ] case 11: trivially reject; //outside of the window return; case 00: continue; //no intersection point case 10 or 01: compute intersection point; refresh one endpoint by the intersection point; 2 Replace endpoint with the intersection Pt 0 1

Cohen-Sutherland for Line Clipping For line i from 1 to 4 switch P0.bit[i] &P1.bit[i ] case 11: trivially reject; //outside of the window return; case 00: continue; //no intersection point case 10 or 01: compute intersection point; refresh one endpoint by the intersection point; 3 continue 0 0

Cohen-Sutherland for Line Clipping For line i from 1 to 4 switch P0.bit[i] &P1.bit[i ] case 11: trivially reject; //outside of the window return; case 00: continue; //no intersection point case 10 or 01: compute intersection point; refresh one endpoint by the intersection point; 4 Replace endpoint with the intersection pt 1 0

Any even better algorithm? A trivial quiz…… There are multiple layers of doors for entering a room, and multiple layers of doors for exiting a room. Assume we dont know the order of the doors. There are only 4 doors A, B, C, D. The doors testify when the person P entered and left. DoorEntering TimeLeaving Time A0.1 B0.5 C0.6 D0.8

Any even better algorithm? A trivial quiz…… There are multiple layers of doors for entering a room, and multiple layers of doors for exiting a room. Assume we dont know the order of the doors. There are only 4 doors A, B, C, D. The doors testify when the person P entered and left. DoorEntering TimeLeaving Time A0.1 B0.5 C0.6 D0.8 Time range of the person in the room Max(0.1,0.5) – Min(0.6,0.8)

Any even better algorithm? A trivial quiz…… There are multiple layers of doors for entering a room, and multiple layers of doors for exiting a room. Assume we dont know the order of the doors. There are only 4 doors A, B, C, D. The doors testify when the person P entered and left. DoorEntering TimeLeaving Time A0.1 B0.6 C0.3 D0.8

Any even better algorithm? A trivial quiz…… There are multiple layers of doors for entering a room, and multiple layers of doors for exiting a room. Assume we dont know the order of the doors. There are only 4 doors A, B, C, D. The doors testify when the person P entered and left DoorEntering TimeLeaving Time A0.1 B0.6 C0.3 D0.8 Time range of the person in the room Max(0.1,0.6) – Min(0.3,0.8) Never in the room!

Cyrus-Beck/Liang-Barsky Line Clipping P1 P0 E (t = 0.03) L (t = 0.85) L(t = 0.8) E (t = -0.03) Entering Time: t = 0.13 Leaving Time: t = 0.8 Ignore ts 1 Max(Entering) ~Min(Leaving) Max(E) > Min(L) ? Totally outside!

Cyrus-Beck/Liang-Barsky Line Clipping Questions we need to answer: – How to decide entering or leaving – Knowing entering or leaving, how to compute t?