168 471 Computer Graphics, KKU. Lecture 81 Clipping on a Raster Display.

Slides:



Advertisements
Similar presentations
CS123 | INTRODUCTION TO COMPUTER GRAPHICS Andries van Dam © Clipping Concepts, Algorithms for line clipping 1 of 16 Clipping - 10/16/12.
Advertisements

Computer Graphics Inf4/MSc 1 Computer Graphics Lecture 7 Scanline algorithm and polygon clipping Taku Komura.
Project-Impact/CSE/IITB/93 CG/Mod-2/SC/1 Basic Raster Graphics "Trifles make perfection, but perfection is no trifle" Michael Angelo ++ Topics Scan conversion.
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 , )
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.
CHAPTER 12 Height Maps, Hidden Surface Removal, Clipping and Level of Detail Algorithms © 2008 Cengage Learning EMEA.
CS 551 / 645: Introductory Computer Graphics Clipping Lines and Polygons.
David Breen, William Regli and Maxim Peysakhov
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:
Clipping Lines Lecture 7 Wed, Sep 10, The Graphics Pipeline From time to time we will discuss the graphics pipeline. The graphics pipeline is the.
Two-Dimensional Viewing Jehee Lee Seoul National University.
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)
Introduction to Computer Graphics Chapter 6 – 2D Viewing Pt 2 1.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Interpolation Clipping.
Implementation Dr. Amy Zhang. Reading 2  Hill, Chapters  Hill, Chapter 10.
Vertices and Fragments I CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
Visibility culling – Clipping. The visibility problem What polygons are visible? There are few visible polygons. –Avoid redundant processing Three classes.
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.
2-Dimension Viewing and Clipping
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 551 / 645: Introductory Computer Graphics
Windowing and clipping
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)
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.
1Computer Graphics Implementation 1 Lecture 15 John Shearer Culture Lab – space 2
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.
Institute for Visualization and Perception Research 1 © Copyright 2000 Haim Levkowitz Raster graphics alg’s for drawing 2D primitives Points of view Application.
Clipping Polygons Dr Nicolas Holzschuch University of Cape Town Modified by Longin Jan Latecki
1 U08181 Computer Graphics Clipping Transformations –Transformations and matrices –Homogeneous matrices –Transformations in SVG.
CENG 538 Advanced Graphics and UIs
Computer Graphics Lecture 14 CLIPPING I Taqdees A. Siddiqi
Computer Graphic 2 D Viewing.
Computer Graphics Clipping.
Introduction to Computer Graphics with WebGL
Transformations contd.
CS 551 / 645: Introductory Computer Graphics
Computer Graphics Shading in OpenGL
Concepts, Algorithms for line clipping
Basic Raster Graphics Algorithms for Drawing 2D Primitives
Clipping Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006
CSCE 441 Computer Graphics: Clipping Polygons Jinxiang Chai
Concepts, algorithms for clipping
Implementation I Ed Angel
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
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.
CS U540 Computer Graphics Prof. Harriet Fell Spring 2007
Basic Raster Graphics Algorithms for Drawing 2D Primitives
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
Implementation I Ed Angel Professor Emeritus of Computer Science
CS U540 Computer Graphics Prof. Harriet Fell Spring 2007
Computer Graphics, KKU. Lecture 11
Presentation transcript:

Computer Graphics, KKU. Lecture 81 Clipping on a Raster Display

Computer Graphics, KKU. Lecture 82 Approaches to Clipping

Computer Graphics, KKU. Lecture 83 Analytical Clipping

Computer Graphics, KKU. Lecture 84 Clipping Lines Against Rectangles

Computer Graphics, KKU. Lecture 85 Clipping Rules

Computer Graphics, KKU. Lecture 86 Computing Intersections

Computer Graphics, KKU. Lecture 87 Cohen-Sutherland Algorithm

Computer Graphics, KKU. Lecture 88 Outcodes

Computer Graphics, KKU. Lecture 89 Outcode Computation typedef unsigned int outcode; enum {TOP = 0x1, BOTTOM = 0x2, RIGHT = 0x4, LEFT = 0x8} outcode CompOutCode( double x, double y, double xmin, double xmax, double ymin, double ymax) { outcode code = 0; if ( y > ymax ) code |= TOP; else if ( y < ymin ) code |= BOTTOM; if ( x > xmax ) code |= RIGHT; else if ( x < xmin ) code |= LEFT; return code; }

Computer Graphics, KKU. Lecture 810 Cohen-Sutherland Procedures

Computer Graphics, KKU. Lecture 811 Cohen-Sutherland Procedures

Computer Graphics, KKU. Lecture 812 Cohen-Sutherland Algorithm

Computer Graphics, KKU. Lecture 813 Cohen-Sutherland Algorithm (cont.)

Computer Graphics, KKU. Lecture 814 Cohen-Sutherland Procedures

Computer Graphics, KKU. Lecture 815 Parametric Line-Clipping Algorithm Introduced by Cyrud and Beck in 1978 Efficiently improved by Liang and Barsky Essentially find the parameter t from P(t) = P 0 + (P 1 -P 0 )t

Computer Graphics, KKU. Lecture 816 Parametric Line-Clipping Algorithm (cont.) Formally, intersections can be classified as PE (potentially entering) and PL (potentially leaving) on the basis of the angle between P 0 P 1 and N i Determine t E or t L for each intersection Select the line segment that has maximum t E and minimum t L If t E > t L, then trivially rejected

Computer Graphics, KKU. Lecture 817 Parametric Line-Clipping Algorithm (cont.)

Computer Graphics, KKU. Lecture 818 Cyrus-Beck Algorithm (Pseudocode)

Computer Graphics, KKU. Lecture 819 Clipping Circles and Ellipses Firstly, do a trivial accept/reject test by intersecting the circle ’ s/elleipse ’ s extent with the clip rectengle. If intersection occurs, divide it into and do the trivial accept/reject test for each. If scan conversion is fast or if the circle is not too large, scissoring on a pixel-by-pixel basis would be more efficient.

Computer Graphics, KKU. Lecture 820 Clipping Polygons Example of polygon clipping, (a) Multiple components. (b) Simple convex case. (c) Concave case.

Computer Graphics, KKU. Lecture 821 Clipping Polygons (cont.) Polygon clipping, edge by edge. (a) Before clipping. (b) Clip on right. (c) Clip on bottom. (d) Clip on left. (e) Clip on top; polygon is fully clipped