CS 430/536 Computer Graphics I Polygon Clipping and Filling Week 3, Lecture 5
Clipping in Computer Graphics
-
Upload
laxman-puri -
Category
Software
-
view
778 -
download
6
description
Transcript of Clipping in Computer Graphics
![Page 1: Clipping in Computer Graphics](https://reader035.fdocuments.in/reader035/viewer/2022081413/549333f2b47959962d8b5648/html5/thumbnails/1.jpg)
# COMPUTER GRAPHICS..!!!
#. CLIPPING
-: Laksh :-
*Roll no. -19.
![Page 2: Clipping in Computer Graphics](https://reader035.fdocuments.in/reader035/viewer/2022081413/549333f2b47959962d8b5648/html5/thumbnails/2.jpg)
# Overview #Introduction.Point Clipping.End Point Codes.Algorithm :
1. Cohen-Sutherland Algorithm.2. Mid-Point Subdivision Algorithm.3. Sutherland-Hodgeman Algorithm.
Text Clipping.
![Page 3: Clipping in Computer Graphics](https://reader035.fdocuments.in/reader035/viewer/2022081413/549333f2b47959962d8b5648/html5/thumbnails/3.jpg)
# Clipping
Clipping is a process of extracting a portion of a data base or identifying elements of a scene or picture inside or outside a specified region, called the clipping region.
E.g.,
![Page 4: Clipping in Computer Graphics](https://reader035.fdocuments.in/reader035/viewer/2022081413/549333f2b47959962d8b5648/html5/thumbnails/4.jpg)
![Page 5: Clipping in Computer Graphics](https://reader035.fdocuments.in/reader035/viewer/2022081413/549333f2b47959962d8b5648/html5/thumbnails/5.jpg)
![Page 6: Clipping in Computer Graphics](https://reader035.fdocuments.in/reader035/viewer/2022081413/549333f2b47959962d8b5648/html5/thumbnails/6.jpg)
# End Point Codes :This technique uses a 4 bit (digit) code to indicate which
of nine regions contains the end point of a line.
This test is formalized by Dan Cohen & Ivan Sutherland.
The rightmost bit is the first bit.
The bits are set to 1, based on the following scheme:- 1st -bit set -if the end pt is to the left of the window.- 2nd-bit set -if the end pt is to the right of the
window.- 3rd-bit set -if the end pt is below the window.- 4th-bit set -if the end pt is above the window.
![Page 7: Clipping in Computer Graphics](https://reader035.fdocuments.in/reader035/viewer/2022081413/549333f2b47959962d8b5648/html5/thumbnails/7.jpg)
![Page 8: Clipping in Computer Graphics](https://reader035.fdocuments.in/reader035/viewer/2022081413/549333f2b47959962d8b5648/html5/thumbnails/8.jpg)
![Page 9: Clipping in Computer Graphics](https://reader035.fdocuments.in/reader035/viewer/2022081413/549333f2b47959962d8b5648/html5/thumbnails/9.jpg)
![Page 10: Clipping in Computer Graphics](https://reader035.fdocuments.in/reader035/viewer/2022081413/549333f2b47959962d8b5648/html5/thumbnails/10.jpg)
![Page 11: Clipping in Computer Graphics](https://reader035.fdocuments.in/reader035/viewer/2022081413/549333f2b47959962d8b5648/html5/thumbnails/11.jpg)
![Page 12: Clipping in Computer Graphics](https://reader035.fdocuments.in/reader035/viewer/2022081413/549333f2b47959962d8b5648/html5/thumbnails/12.jpg)
![Page 13: Clipping in Computer Graphics](https://reader035.fdocuments.in/reader035/viewer/2022081413/549333f2b47959962d8b5648/html5/thumbnails/13.jpg)
Mid Point Subdivision Algorithm
The Cohen-Sutherland algorithm requires the calculation of the intersection of the line with the window edge.
The direct calculation is avoided by performing a binary search for the intersection by always dividing the line at its midpoint.
![Page 14: Clipping in Computer Graphics](https://reader035.fdocuments.in/reader035/viewer/2022081413/549333f2b47959962d8b5648/html5/thumbnails/14.jpg)
![Page 15: Clipping in Computer Graphics](https://reader035.fdocuments.in/reader035/viewer/2022081413/549333f2b47959962d8b5648/html5/thumbnails/15.jpg)
![Page 16: Clipping in Computer Graphics](https://reader035.fdocuments.in/reader035/viewer/2022081413/549333f2b47959962d8b5648/html5/thumbnails/16.jpg)
![Page 17: Clipping in Computer Graphics](https://reader035.fdocuments.in/reader035/viewer/2022081413/549333f2b47959962d8b5648/html5/thumbnails/17.jpg)
![Page 18: Clipping in Computer Graphics](https://reader035.fdocuments.in/reader035/viewer/2022081413/549333f2b47959962d8b5648/html5/thumbnails/18.jpg)