CS552: Computer Graphics Lecture 12: 3D Clipping.

Slides:



Advertisements
Similar presentations
3D Clipping & Viewing process
Advertisements

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.
CS 551 / 645: Introductory Computer Graphics Clipping Lines and Polygons.
Course Website: Computer Graphics 4: Viewing In 2D.
Two-Dimensional Viewing Jehee Lee Seoul National University.
Computer Graphics : Clipping
Computer Graphics Viewing.
Clipping CSE 403 Computer Graphics Cohen Sutherland Algorithm (Line)
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.
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.
Course Website: Computer Graphics 9: Clipping In 3D.
1 Lecture 8 Clipping Viewing transformations Projections.
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,
Graphics Pipeline Clipping CMSC 435/634. Graphics Pipeline Object-order approach to rendering Sequence of operations – Vertex processing – Transforms.
2/26/04© University of Wisconsin, CS559 Spring 2004 Last Time General Orthographic Viewing –Specifying cameras in world coordinates –Building world  view.
CS 325 Introduction to Computer Graphics 03 / 03 / 2010 Instructor: Michael Eckmann.
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.
02/26/02 (c) 2002 University of Wisconsin, CS 559 Last Time Canonical view pipeline Orthographic projection –There was an error in the matrix for taking.
Advanced Computer Graphics Three Dimensional Viewing
CS 325 Introduction to Computer Graphics 03 / 08 / 2010 Instructor: Michael Eckmann.
Clipping Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by David Luebke)
CS 480/680 Computer Graphics Shading in OpenGL Dr. Frederick C Harris, Jr. Fall 2013.
Windows, Viewports, and Clipping
Three-Dimensional Viewing Jehee Lee Seoul National University.
Basic Perspective Projection Watt Section 5.2, some typos Define a focal distance, d, and shift the origin to be at that distance (note d is negative)
EEL Introduction to Computer Graphics
Three-Dimensional Viewing
Three-Dimensional Viewing Hearn & Baker Chapter 7
Viewing and Projection
1Computer Graphics Implementation 1 Lecture 15 John Shearer Culture Lab – space 2
CS552: Computer Graphics Lecture 11: Orthographic Projection.
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.
Graphics Graphics & Graphical Programming Lecture 23 - Viewing & Clipping.
Perspective View Volume View Volume Far Near Window Far Near Window Center of Projection Center of Projection (a) Original Orientation (b) After Transformation.
Three-Dimensional Viewing Clipping Computer Graphics C Version (456p - 462p)
Computer Graphics Viewing. 2 of 30 Viewing in 2D Window in world coordinates. 45  250  Viewport in Device coords 250 x 250 Pixels.
CS552: Computer Graphics Lecture 9: Perspective Projection.
Lecture 9 From Vertices to Fragments. Objectives Introduce basic implementation strategies Clipping Rasterization hidden-surface removal.
Chapter 71 Computer Graphics - Chapter 7 From Vertices to Fragments Objectives are: How your program are processed by the system that you are using, Learning.
Three Dimensional Viewing
Computer Graphics Lecture 14 CLIPPING I Taqdees A. Siddiqi
Introduction to Computer Graphics with WebGL
Computer Graphics CC416 Week 13 Clipping.
Transformations contd.
Computer Graphics Shading in OpenGL
Concepts, Algorithms for line clipping
Prof. Lizhuang Ma Shanghai Jiao Tong University
3D rezanje 3D Clipping view frustrum clipping planes clipped.
Concepts, algorithms for clipping
3D Clipping.
Implementation I Ed Angel
Graphics Pipeline Clipping
Computer Graphics 9: Clipping In 3D
3D Rendering Pipeline Hidden Surface Removal 3D Primitives
Clipping Computer Graphics Cohen Sutherland Algorithm (Line)
Lecture 13 Clipping & Scan Conversion
© University of Wisconsin, CS559 Fall 2004
3D rezanje 3D Clipping view frustrum clipping planes clipped.
Prof. Lizhuang Ma Shanghai Jiao Tong University
Clipping Clipping Sutherland-Hodgman Clipping
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:

CS552: Computer Graphics Lecture 12: 3D Clipping

Recap Parallel projection Normalized coordinate transformation o Orthographic o Oblique o Perspective

Objective After completing this lecture students will be able to Extend 2D clipping algorithm for 3D Solve mathematical problems on 3D clipping

When Do We Clip? We perform clipping after the projection transformation and normalisation are complete So, we have the following: We apply all clipping to these homogeneous coordinates

Dividing Up The World Similar to the case in two dimensions, we divide the world into regions This time we use a 6-bit region code to give us 27 different region codes The bits in these regions codes are as follows: bit 6 Far bit 5 Near bit 4 Top bit 3 Bottom bit 2 Right bit 1 Left

Dividing Up The World (cont..) Because we have a normalised clipping volume we can test for these regions as follows: Rearranging these we get:

Region Codes FarNearTopBottomRightLeft

Different test cases

Line Clipping To clip lines we first label all end points with the appropriate region codes We can trivially accept all lines with both end-points in the [000000] region We can trivially reject all lines whose end points share a common bit in any position o This is just like the 2 dimensional case as these lines can never cross the viewing volume o In the example that follows the line from P 3 [010101] to P 4 [100110] can be rejected

The Equation Of The Line For 3D Clipping

From this parametric equation of a line we can generate the equations for the homogeneous coordinates:

3D Line Clipping Example Consider the line P 1 [000010] to P 2 [001001] Because the lines have different values in bit 2 we know the line crosses the right boundary

3D Line Clipping Example

3D Polygon Clipping However the most common case in 3D clipping is that we are clipping graphics objects made up of polygons

3D Polygon Clipping In this case we first try to eliminate the entire object using its bounding volume Next we perform clipping on the individual polygons using the Sutherland-Hodgman algorithm we studied previously

Arbitrary Clipping Planes To clip a three-dimensional scene using additional planes that can be specified in any spatial orientation Objects behind the plane are to be clipped

Line clipping Case 1: Clip the entire line if both endpoints satisfy Case 2: Save the entire line if both endpoints satisfy Case 3: Point P is on the clipping plane if it satisfies the plane equation

Thank you Next Lecture: Raster Graphics