3D Clipping & Viewing process

Slides:



Advertisements
Similar presentations
CGPage: 1 We can define a window as a rectangular region of the world coordinate space, and the viewport as a rectangular region of the device coordinate.
Advertisements

Rezanje črt in poligonov. World window & viewport window viewport screen window world window.
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.
Java ThreadsGraphics Programming Graphics Programming: Windows, Viewports & Clipping.
Computer Graphics Lecture 8 Arbitrary Viewing II: More Projection, Clipping and Mathematics of 3D Viewing.
©Larry F. Hodges (modified by Amos Johnson) 1 Arbitrary 3-D View-Plane.
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.
Clipping CSE 403 Computer Graphics Cohen Sutherland Algorithm (Line)
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.
Course Website: Computer Graphics 9: Clipping In 3D.
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.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Implementation I Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
CS 325 Introduction to Computer Graphics 03 / 03 / 2010 Instructor: Michael Eckmann.
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.
CS 480/680 Computer Graphics Shading in OpenGL Dr. Frederick C Harris, Jr. Fall 2013.
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
Basic Projections 2D to 3D
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
Graphics Graphics & Graphical Programming Lecture 23 - Viewing & Clipping.
Clipping. Before clipping… After clipping… Point Clipping Display P = (x, y) if xw min
Three-Dimensional Viewing Clipping Computer Graphics C Version (456p - 462p)
3D Viewing and Clipping Ming Ouhyoung 歐陽明 Professor Dept. of CSIE and GINM NTU.
Lecture 9 From Vertices to Fragments. Objectives Introduce basic implementation strategies Clipping Rasterization hidden-surface removal.
CS552: Computer Graphics Lecture 12: 3D 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.
Transformations contd.
CS 551 / 645: Introductory Computer Graphics
Computer Graphics Shading in OpenGL
Concepts, Algorithms for line clipping
Prof. Lizhuang Ma Shanghai Jiao Tong University
2D Viewing & Clipping 한신대 류승택
Viewing in 3D Chapter 6.
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
WINDOWING AND CLIPPING
Computer Graphics : Viewing In 2D
Clipping Computer Graphics Cohen Sutherland Algorithm (Line)
WINDOWING AND CLIPPING
Lecture 13 Clipping & Scan Conversion
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.
3D rezanje 3D Clipping view frustrum clipping planes clipped.
CS U540 Computer Graphics Prof. Harriet Fell Spring 2007
Prof. Lizhuang Ma Shanghai Jiao Tong University
Clipping Clipping Sutherland-Hodgman Clipping
CS U540 Computer Graphics Prof. Harriet Fell Spring 2007
Viewing Transformations II
Clipping University of British Columbia CPSC 314 Computer Graphics
Implementation I Ed Angel Professor Emeritus of Computer Science
CS U540 Computer Graphics Prof. Harriet Fell Spring 2007
COMPUTER GRAPHICS Clipping
Presentation transcript:

3D Clipping & Viewing process

3D Cohen-Sutherland Algorithm Y axis +1 y=z Back Front Clipping Clipping Plane z=-1 Plane -Z -1 3-D Extension of 2-D Cohen-Sutherland Algorithm, y=-z Outcode of six bits. A bit is true (1) when the appropriate condition is satisfied -1 Bit 1 - Point is above view volume y > -z Bit 2 - Point is below view volume y < z Bit 3 - Point is right of view volume x > -z Bit 4 - Point is left of view volume x < z Bit 5 - Point is behind view volume z < -1 Bit 6 - Point is in front of view volume z > zmin

3D Cohen-Sutherland Algorithm A line is trivially accepted if both endpoints have a code of all zeros. A line is trivially rejected if the bit-by-bit logical AND of the codes is not all zeros. Otherwise Calculate intersections. On the y = z plane from parametric equation of the line: y + t( y - y ) = z + t( z - z ) 1 1 Solve for t and calculate x and y. Already know z = y

3D Cohen-Sutherland Algorithm If t not between [0, 1], then the intersection in not between P0 and P1 t = (z0-y0)/[(y1 – y0)-(z1-z0)] If t between [0, 1], then use t to find x and y x = x0 + [(x1 – x0)(z0-y0)]/[(y1-y0)-(z1-z0)] y = y0 + [(y1 – y0)(z0-y0)]/[(y1-y0)-(z1-z0)]

3D viewing process Specify a 3D view volume Clip against view volume Nper = [Sper ][SHper ][T(-PRP) ][R ][T(-VRP)] Clip against view volume Project onto a 2D viewing plane Mper : d = -PRPn Apply 2D viewing transformations to map window contents into 2D-image viewport V = [T-1][S][T]

3D viewing Transformation 3D to 2D P’(x’,y’,z’,w) = [Mper][Nper][P(x,y,z,1)] 2D to Image P’’(x,y,1) = [V][P(x’/w,y’/w,1)]