Docsity

chapter four for cryptography course, Lecture notes of Computer Science

Partial preview of the text

Download chapter four for cryptography course and more Lecture notes Computer Science in PDF only on Docsity!

Chapter Four

2D Clipping

1. Introduction

2. Point Clipping

3. Line Clipping

4. Polygon/Area Clipping

5. Text Clipping

6. Curve Clipping

When we display a scene only those objects within a particular window are displayed wymax wymin wxmin wxmax Window World Coordinates

June 8, 2021 Computer Graphics 5 Because drawing things to a display takes time we clip everything outside the window wymax wymin wxmin wxmax World Coordinates Window

1.2 Shielding:

  • (^) Shielding or exterior clipping is the reverse operation of clipping where window act as the block used to abstract the view.
  • (^) Examples
    • (^) A multi view window system
    • (^) The design of page layouts in advertising or publishing applications or for adding labels or design patterns to picture.
    • (^) Combining graphs, maps o schematics

wymax wymin wxmin wxmax Window World Coordinates

1.4 Applications:

  • (^) Extract part of a defined scene for viewing.
  • (^) Drawing operations such as erase, copy, move etc.
  • (^) Displaying multi view windows.
  • (^) Creating objects using solid modeling techniques.
  • (^) Anti-aliasing line segments or object boundaries.
  • (^) Identify visible surfaces in 3D views.

1.5 Types of clipping:

  • (^) Three types of clipping techniques are used depending upon when the clipping operation is performed a. Analytical clipping
  • (^) Clip it before you scan convert it
  • (^) used mostly for lines, rectangles, and polygons, where clipping algorithms are simple and efficient

c. Raster Clipping

  • (^) Clip it after scan conversion
  • (^) render everything onto a temporary canvas and copy the clipping region - (^) wasteful, but simple and easy, - (^) often used for text

Foley and van Dam suggest the following:

  • (^) for floating point graphics libraries, try to use analytical clipping
  • (^) for integer graphics libraries
    • (^) analytical clipping for lines and polygons
    • (^) others, do during scan conversion
  • (^) sometimes both analytical and raster clipping performed

1. Introduction

2. Point Clipping

3. Line Clipping

4. Polygon/Area Clipping

5. Text Clipping

6. Curve Clipping

Point Clipping

  • (^) Simple and Easy
  • (^) a point ( x,y ) is not clipped if: wxmin ≤ x ≤ wxmax & wymin ≤ y ≤ wymax
  • (^) otherwise it is clipped wymax wymin wxmin wxmax Window P 1 P 2 P 5 P 7 P 10 P 9 P 4 P 8 Clipped Points Within the Window are Not Clipped Clipped Clipped Clipped

Line Clipping

  • (^) It is Harder than point clipping
  • (^) We first examine the end- points of each line to see if they are in the window or not - (^) Both endpoints inside, line trivially accepted - (^) One in and one out, line is partially inside - (^) Both outside, might be partially inside - (^) What about trivial cases? ymin ymax xmin xmax

Line Clipping

Situation Solution Example Both end-points inside the window Don’t clip One end-point inside the window, one outside Must clip Both end-points outside the window Don’t know!