Graphics 2 D Viewing cgvr korea ac kr
- Slides: 61
Graphics 2 D Viewing 고려대학교 컴퓨터 그래픽스 연구실 cgvr. korea. ac. kr 1 Graphics Lab @ Korea University
Contents CGVR 3 D Rendering Pipeline n 2 D Rendering Pipeline n Clipping n Cohen-Sutherland Line Clipping n Sutherland-Hodgeman Polygon Clipping n Viewport Transformation n Scan Conversion n Summary of Transformation n cgvr. korea. ac. kr 2 Graphics Lab @ Korea University
3 D Rendering Pipeline 3 D Primitives CGVR 3 D Modeling Coordinates Model Transformation 3 D World Coordinates Lighting 3 D World Coordinates Viewing Transformation 3 D Viewing Coordinates Projection Transformation 2 D Projection Coordinates Clipping 2 D Projection Coordinates Viewport Transformation 2 D Device Coordinates Scan Conversion 2 D Device Coordinates Image cgvr. korea. ac. kr 3 Graphics Lab @ Korea University
3 D Rendering Pipeline 3 D Primitives CGVR 3 D Modeling Coordinates Model Transformation 3 D World Coordinates Lighting 3 D World Coordinates Viewing Transformation 3 D Viewing Coordinates Projection Transformation 2 D Projection Coordinates Clipping 2 D Projection Coordinates Viewport Transformation 2 D Device Coordinates Scan Conversion 2 D Device Coordinates Image cgvr. korea. ac. kr 4 Graphics Lab @ Korea University
2 D Rendering Pipeline CGVR 3 D Primitives 2 D Primitives Clipping Viewport Transformation Scan Conversion Clip portions of geometric primitives residing outside window Transform the clipped primitives from screen to image coordinates Fill pixel representing primitives in screen coordinates Image cgvr. korea. ac. kr 5 Graphics Lab @ Korea University
2 D Rendering Pipeline CGVR 3 D Primitives 2 D Primitives Clipping Viewport Transformation Scan Conversion Clip portions of geometric primitives residing outside window Transform the clipped primitives from screen to image coordinates Fill pixel representing primitives in screen coordinates Image cgvr. korea. ac. kr 6 Graphics Lab @ Korea University
Clipping n CGVR Avoid Drawing Parts of Primitives Outside Window defines part of scene being viewed n Must draw geometric primitives only inside window n World Coordinates cgvr. korea. ac. kr 7 Graphics Lab @ Korea University
Clipping n CGVR Avoid Drawing Parts of Primitives Outside Window defines part of scene being viewed n Must draw geometric primitives only inside window n cgvr. korea. ac. kr 8 Graphics Lab @ Korea University
Clipping n CGVR Avoid Drawing Parts of Primitives Outside Window n n n Points Lines Polygons Circles etc. cgvr. korea. ac. kr 9 Graphics Lab @ Korea University
Point Clipping n CGVR Is Point(x, y) Inside the Clip Window? wy 2 Inside = (x>=wx 1) && (x<=wx 2) && (x, y) (y>=wy 1) && (y<=wy 2); wy 1 wx 1 cgvr. korea. ac. kr wx 2 10 Graphics Lab @ Korea University
Line Clipping n CGVR Find the Part of a Line Inside the Clip Window P 7 P 1 P 4 P 3 P 2 P 6 P 5 cgvr. korea. ac. kr 11 P 8 P 10 P 9 Before Clipping Graphics Lab @ Korea University
Line Clipping n CGVR Find the Part of a Line Inside the Clip Window P’ 7 P 4 P’ 8 P 3 P 6 P’ 5 After Clipping cgvr. korea. ac. kr 12 Graphics Lab @ Korea University
Cohen-Sutherland Line Clipping n CGVR Use Simple Tests to Classify Easy Cases First P 7 P 1 P 4 P 3 P 2 P 6 P 5 cgvr. korea. ac. kr 13 P 8 P 10 P 9 Graphics Lab @ Korea University
Cohen-Sutherland Line Clipping n CGVR Classify Some Lines Quickly by AND of Bit Codes Representing Regions of Two Endpoints (Must Be 0) P 7 0001 1001 0101 Bit 4 P 1 P 4 1000 P 3 P 2 0000 P 6 1010 P 5 Bit 1 cgvr. korea. ac. kr P 8 0100 14 0010 P 9 0110 Bit 3 Bit 2 Graphics Lab @ Korea University
Cohen-Sutherland Line Clipping n CGVR Classify Some Lines Quickly by AND of Bit Codes Representing Regions of Two Endpoints (Must Be 0) P 7 0001 1001 0101 Bit 4 P 1 P 4 1000 P 3 P 2 0000 P 6 1010 P 5 Bit 1 cgvr. korea. ac. kr P 8 0100 15 0010 P 9 0110 Bit 3 Bit 2 Graphics Lab @ Korea University
Cohen-Sutherland Line Clipping n CGVR Classify Some Lines Quickly by AND of Bit Codes Representing Regions of Two Endpoints (Must Be 0) P 7 0001 1001 0101 Bit 4 P 4 1000 P 3 P 8 0100 0000 P 6 1010 P 5 Bit 1 cgvr. korea. ac. kr 16 0010 P 9 0110 Bit 3 Bit 2 Graphics Lab @ Korea University
Cohen-Sutherland Line Clipping n CGVR Compute Intersections with Window Boundary for Lines That Can’t be Classified Quickly P 7 0001 1001 0101 P 4 1000 P 3 P 8 0100 0000 P 6 1010 P 5 Bit 1 cgvr. korea. ac. kr 17 0010 P 9 Bit 4 0110 Bit 3 Bit 2 Graphics Lab @ Korea University
Cohen-Sutherland Line Clipping n CGVR Compute Intersections with Window Boundary for Lines That Can’t be Classified Quickly P 7 0001 1001 0101 P 4 1000 P 3 P 8 0100 0000 P 6 1010 P 5 Bit 1 cgvr. korea. ac. kr 18 0010 P 9 Bit 4 0110 Bit 3 Bit 2 Graphics Lab @ Korea University
Cohen-Sutherland Line Clipping n CGVR Compute Intersections with Window Boundary for Lines That Can’t be Classified Quickly P 7 0001 1001 0101 P 4 1000 P 3 P 8 0100 0000 P 6 P’ 5 1010 Bit 1 cgvr. korea. ac. kr 19 0010 P 9 Bit 4 0110 Bit 3 Bit 2 Graphics Lab @ Korea University
Cohen-Sutherland Line Clipping n CGVR Compute Intersections with Window Boundary for Lines That Can’t be Classified Quickly P 7 0001 1001 0101 P 4 1000 P 3 P 8 0100 0000 P 6 P’ 5 1010 Bit 1 cgvr. korea. ac. kr 20 0010 P 9 Bit 4 0110 Bit 3 Bit 2 Graphics Lab @ Korea University
Cohen-Sutherland Line Clipping n CGVR Compute Intersections with Window Boundary for Lines That Can’t be Classified Quickly P 7 0001 1001 0101 P 4 1000 P 3 P 8 0100 0000 P 6 P’ 5 1010 Bit 1 cgvr. korea. ac. kr 21 0010 P 9 Bit 4 0110 Bit 3 Bit 2 Graphics Lab @ Korea University
Cohen-Sutherland Line Clipping n CGVR Compute Intersections with Window Boundary for Lines That Can’t be Classified Quickly P 7 0001 1001 0101 P 4 1000 P 3 P 8 0100 0000 P 6 P’ 5 1010 Bit 1 cgvr. korea. ac. kr 22 0010 P 9 Bit 4 0110 Bit 3 Bit 2 Graphics Lab @ Korea University
Cohen-Sutherland Line Clipping n CGVR Compute Intersections with Window Boundary for Lines That Can’t be Classified Quickly 1001 0101 P’ 7 P 4 1000 P 3 P 8 0100 0000 P 6 P’ 5 1010 Bit 1 cgvr. korea. ac. kr 23 0010 P 9 Bit 4 0110 Bit 3 Bit 2 Graphics Lab @ Korea University
Cohen-Sutherland Line Clipping n CGVR Compute Intersections with Window Boundary for Lines That Can’t be Classified Quickly 1001 0101 P’ 7 P 4 1000 P 3 P 8 0100 0000 P 6 P’ 5 1010 Bit 1 cgvr. korea. ac. kr 24 0010 P 9 Bit 4 0110 Bit 3 Bit 2 Graphics Lab @ Korea University
Cohen-Sutherland Line Clipping n CGVR Compute Intersections with Window Boundary for Lines That Can’t be Classified Quickly 1001 0101 P’ 7 P 4 1000 P 3 P’ 8 0000 0100 P 6 P’ 5 1010 Bit 1 cgvr. korea. ac. kr 25 0010 Bit 4 P 10 P 9 0110 Bit 3 Bit 2 Graphics Lab @ Korea University
Cohen-Sutherland Line Clipping n CGVR Compute Intersections with Window Boundary for Lines That Can’t be Classified Quickly 1001 0101 P’ 7 P 4 1000 P 3 P’ 8 0000 0100 P 6 P’ 5 1010 Bit 1 cgvr. korea. ac. kr 26 0010 Bit 4 P 10 P 9 0110 Bit 3 Bit 2 Graphics Lab @ Korea University
Cohen-Sutherland Line Clipping n CGVR Compute Intersections with Window Boundary for Lines That Can’t be Classified Quickly 1001 0101 P’ 7 P 4 1000 P 3 P’ 8 0000 0100 P 6 P’ 5 1010 Bit 1 cgvr. korea. ac. kr 27 0010 Bit 4 P 10 P 9 0110 Bit 3 Bit 2 Graphics Lab @ Korea University
Cohen-Sutherland Line Clipping n CGVR Compute Intersections with Window Boundary for Lines That Can’t be Classified Quickly 1001 0101 P’ 7 P 4 1000 P 3 P’ 8 0000 0100 P 6 P’ 5 1010 Bit 1 cgvr. korea. ac. kr 28 0010 Bit 4 P 10 P 9 0110 Bit 3 Bit 2 Graphics Lab @ Korea University
Cohen-Sutherland Line Clipping n CGVR Compute Intersections with Window Boundary for Lines That Can’t be Classified Quickly 1001 0101 P’ 7 P 4 1000 P 3 P’ 8 0000 0100 P 6 P’ 5 1010 Bit 1 cgvr. korea. ac. kr 29 0010 Bit 4 P 10 P’ 90110 Bit 3 Bit 2 Graphics Lab @ Korea University
Cohen-Sutherland Line Clipping n CGVR Compute Intersections with Window Boundary for Lines That Can’t be Classified Quickly 1001 0101 P’ 7 P 4 1000 P 3 P’ 8 0000 0100 P 6 P’ 5 1010 Bit 1 cgvr. korea. ac. kr 30 0010 Bit 4 P 10 P’ 90110 Bit 3 Bit 2 Graphics Lab @ Korea University
Cohen-Sutherland Line Clipping n CGVR Compute Intersections with Window Boundary for Lines That Can’t be Classified Quickly 1001 0101 P’ 7 P 4 1000 P 3 Bit 4 P’ 8 0000 0100 P 6 P’ 5 1010 Bit 1 cgvr. korea. ac. kr 31 0010 0110 Bit 3 Bit 2 Graphics Lab @ Korea University
Polygon Clipping n CGVR Find the Part of a Polygon Inside the Clip Window? Before Clipping cgvr. korea. ac. kr 32 Graphics Lab @ Korea University
Polygon Clipping n CGVR Find the Part of a Polygon Inside the Clip Window? After Clipping cgvr. korea. ac. kr 33 Graphics Lab @ Korea University
Sutherland-Hodgeman Polygon Clipping n CGVR Clip to Each Window Boundary One at a Time cgvr. korea. ac. kr 34 Graphics Lab @ Korea University
Sutherland-Hodgeman Polygon Clipping n CGVR Clip to Each Window Boundary One at a Time cgvr. korea. ac. kr 35 Graphics Lab @ Korea University
Sutherland-Hodgeman Polygon Clipping n CGVR Clip to Each Window Boundary One at a Time cgvr. korea. ac. kr 36 Graphics Lab @ Korea University
Sutherland-Hodgeman Polygon Clipping n CGVR Clip to Each Window Boundary One at a Time cgvr. korea. ac. kr 37 Graphics Lab @ Korea University
Sutherland-Hodgeman Polygon Clipping n CGVR Clip to Each Window Boundary One at a Time cgvr. korea. ac. kr 38 Graphics Lab @ Korea University
Clipping to a Boundary n CGVR Do Inside Test for Each Point in Sequence, Insert New Points When Cross Window Boundary, Remove Points Outside Window Boundary P 2 P 1 Window Boundary Inside P 5 P 3 Outside P 4 cgvr. korea. ac. kr 39 Graphics Lab @ Korea University
Clipping to a Boundary n CGVR Do Inside Test for Each Point in Sequence, Insert New Points When Cross Window Boundary, Remove Points Outside Window Boundary P 2 P 1 Window Boundary Inside P 5 P 3 Outside P 4 cgvr. korea. ac. kr 40 Graphics Lab @ Korea University
Clipping to a Boundary n CGVR Do Inside Test for Each Point in Sequence, Insert New Points When Cross Window Boundary, Remove Points Outside Window Boundary P 2 P 1 Window Boundary Inside P 5 P 3 Outside P 4 cgvr. korea. ac. kr 41 Graphics Lab @ Korea University
Clipping to a Boundary n CGVR Do Inside Test for Each Point in Sequence, Insert New Points When Cross Window Boundary, Remove Points Outside Window Boundary P 2 P 1 Window Boundary Inside P 5 P 3 Outside P 4 cgvr. korea. ac. kr 42 Graphics Lab @ Korea University
Clipping to a Boundary n CGVR Do Inside Test for Each Point in Sequence, Insert New Points When Cross Window Boundary, Remove Points Outside Window Boundary P 2 P 1 Window Boundary P’ Inside P 5 P 3 Outside P 4 cgvr. korea. ac. kr 43 Graphics Lab @ Korea University
Clipping to a Boundary n CGVR Do Inside Test for Each Point in Sequence, Insert New Points When Cross Window Boundary, Remove Points Outside Window Boundary P 2 P 1 Window Boundary P’ Inside P 5 P 3 Outside P 4 cgvr. korea. ac. kr 44 Graphics Lab @ Korea University
Clipping to a Boundary n CGVR Do Inside Test for Each Point in Sequence, Insert New Points When Cross Window Boundary, Remove Points Outside Window Boundary P 2 P 1 Window Boundary P’ Inside P 5 P 3 Outside P 4 cgvr. korea. ac. kr 45 Graphics Lab @ Korea University
Clipping to a Boundary n CGVR Do Inside Test for Each Point in Sequence, Insert New Points When Cross Window Boundary, Remove Points Outside Window Boundary P 2 P 1 Window Boundary P’ P 3 P” Inside P 5 Outside P 4 cgvr. korea. ac. kr 46 Graphics Lab @ Korea University
Clipping to a Boundary n CGVR Do Inside Test for Each Point in Sequence, Insert New Points When Cross Window Boundary, Remove Points Outside Window Boundary P 2 Window Boundary P’ P 1 P” Inside Outside cgvr. korea. ac. kr 47 Graphics Lab @ Korea University
2 D Rendering Pipeline CGVR 3 D Primitives 2 D Primitives Clipping Viewport Transformation Scan Conversion Clip portions of geometric primitives residing outside window Transform the clipped primitives from screen to image coordinates Fill pixel representing primitives in screen coordinates Image cgvr. korea. ac. kr 48 Graphics Lab @ Korea University
Viewport Transformation n CGVR Transform 2 D Geometric Primitives from Screen Coordinate System (Projection Coordinates) to Image Coordinate System (Device Coordinates) Screen Image Viewport cgvr. korea. ac. kr 49 Graphics Lab @ Korea University
Window vs. Viewport n CGVR Window World-coordinate area selected for display n What is to be viewed n n Viewport Area on the display device to which a window is mapped n Where it is to be displayed n cgvr. korea. ac. kr 50 Graphics Lab @ Korea University
Viewport Transformation n CGVR Window-to-Viewport Mapping Window wy 2 (wx, wy) wy 1 wx 2 Screen Coordinates vy 2 Viewport (vx, vy) vy 1 vx 2 Image Coordinates vx = vx 1 + (wx – wx 1) * (vx 2 – vx 1) / (wx 2 – wx 1); vy = vy 1 + (wy – wy 1) * (vy 2 – vy 1) / (wy 2 – wy 1); cgvr. korea. ac. kr 51 Graphics Lab @ Korea University
2 D Rendering Pipeline CGVR 3 D Primitives 2 D Primitives Clipping Viewport Transformation Scan Conversion Clip portions of geometric primitives residing outside window Transform the clipped primitives from screen to image coordinates Fill pixel representing primitives in screen coordinates Image cgvr. korea. ac. kr 52 Graphics Lab @ Korea University
Scan Conversion n Definition n n CGVR Figure out which pixels to fill Example n Filling the inside of a triangle P 1 P 2 cgvr. korea. ac. kr 53 P 3 Graphics Lab @ Korea University
Triangle Scan Conversion n CGVR Simple Algorithm Color all pixels inside a triangle n Inside triangle test n o A point is inside a triangle if it is in the positive halfspace of all three boundary lines L 1 P L 3 L 2 cgvr. korea. ac. kr 54 Graphics Lab @ Korea University
Triangle Scan Conversion n CGVR Triangle Sweep-Line Algorithm n Take advantage of spatial coherence Compute which pixels are inside using horizontal spans o Process horizontal spans in scan-line order o n Take advantage of edge linearity o Use edge slopes to update coordinates incrementally dy cgvr. korea. ac. kr 55 dx Graphics Lab @ Korea University
Polygon Scan Conversion n CGVR Fill Pixels Inside a Polygon n n n Triangle Quadrilateral Convex Star-Shaped Concave Self-Intersecting Holes cgvr. korea. ac. kr 56 Graphics Lab @ Korea University
Inside Polygon Rule n CGVR Need Better Test for Points Inside a Polygon n “Inside triangle test” works only for convex polygon L L 1 1 L 2 L 5 B L 5 A L 3 L 4 Convex Polygon cgvr. korea. ac. kr 57 L 4 Concave Polygon Graphics Lab @ Korea University
Inside Polygon Rule n CGVR Odd-Parity Rule n Any ray from P to infinity crosses odd number of edges Concave cgvr. korea. ac. kr Self-Intersecting 58 With Holes Graphics Lab @ Korea University
Polygon Scan Conversion n CGVR Polygon Line-Sweep Algorithm n Incremental algorithm to find spans, and determine insideness with odd-parity rule Triangle cgvr. korea. ac. kr 59 Polygon Graphics Lab @ Korea University
Polygon Scan Conversion n CGVR Hardware Scan Conversion n Convert everything into Triangles cgvr. korea. ac. kr 60 Graphics Lab @ Korea University
Summary of Transformation CGVR P(x, y, z) 3 D Object Coordinates Modeling Transformation 3 D World Coordinates Viewing Transformation 3 D Viewing Coordinates Projection Transformation 2 D Projection Coordinates Window-to-Viewport Transformation P(x, y) cgvr. korea. ac. kr 61 2 D Device Coordinates Graphics Lab @ Korea University
- Translate
- Cartesian components
- Cgvr
- Viewing pipeline
- Define projection in computer graphics
- Graphics hardware in computer graphics ppt
- Most of the graphics monitors today operate as
- Orderly visual search pattern definition
- Steps in viewing
- Normalized device coordinate
- Eccentric viewing techniques occupational therapy
- Viewing angel
- Viewing coordinate sering juga disebut
- Soal dan jawaban grafika komputer
- Three types of claim
- Interior and exterior clipping in computer graphics
- Slit diffraction
- Module 19 visual organization and interpretation
- Half section view drawing
- While viewing a slide of rapidly moving sperm cells
- Thank you for viewing my presentation
- Constant intensity shading
- Wide reading critical film viewing
- Korea result
- Iptv zone korea
- Ebsco korea
- Standard diagnostics korea
- Drawing vector graphics laboratory
- Molit korea
- Uwayapply korea university
- North korea unlimited government
- Korea institute of sport science
- Kramer korea
- How are the physical features of japan and korea similar?
- Dns server korea
- Cnf korea
- Spread of china's literature to heian japan and korea
- Unang digmaang pandaigdig sa timog asya
- Riss korea
- Korean war map worksheet
- Catholic university of korea songsin campus
- Rist korea
- Dtr vms
- South korea economic continuum
- Korea kosha
- Korea foundation fellowship
- Kncap test protocol
- Fleishmanhillard mission statement
- Korea university animation
- Korea
- Which statement best describes apartheid
- Dow chemical company profile
- Multibase dow corning
- Goodhill korea centre pte ltd
- Modern korea 2
- Kupid portal
- Donga university korea
- Korea result
- South korea myanmar
- Lipton korea
- Ui korea
- Software hrd