18
# COMPUTER GRAPHICS..!!! #. CLIPPING -: Laksh :- *Roll no. - 19.

Clipping in Computer Graphics

Embed Size (px)

DESCRIPTION

Clipping based on S.Y.BSc.(Computer Science) Syallbus.

Citation preview

Page 1: Clipping in Computer Graphics

# COMPUTER GRAPHICS..!!!

#. CLIPPING

-: Laksh :-

*Roll no. -19.

Page 2: Clipping in Computer Graphics

# 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

# 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
Page 5: Clipping in Computer Graphics
Page 6: Clipping in Computer Graphics

# 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
Page 8: Clipping in Computer Graphics
Page 9: Clipping in Computer Graphics
Page 10: Clipping in Computer Graphics
Page 11: Clipping in Computer Graphics
Page 12: Clipping in Computer Graphics
Page 13: Clipping in Computer Graphics

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
Page 15: Clipping in Computer Graphics
Page 16: Clipping in Computer Graphics
Page 17: Clipping in Computer Graphics
Page 18: Clipping in Computer Graphics