UNIT 2- PART_II
UNIT 2- PART_II
Multimedia Applications
SCSA1503
Unit 2
Syllabus
03/02/2025 12
Types of Lines
03/02/2025 14
Before and after clipping
03/02/2025 15
Applications of clipping
Clipping can be applied to world co-ordinates. The
contents inside the window will be mapped to device co-
ordinates. Another alternative is a complete world co-
ordinates picture is assigned to device co-ordinates, and
then clipping of viewport boundaries is done.
• It will extract part we desire.
• For identifying the visible and invisible area in the 3D
object.
• For creating objects using solid modeling.
• For drawing operations.
• Operations related to the pointing of an object.
• For deleting, copying, moving part of an object.
03/02/2025 16
Types of Clipping
• Point Clipping
• Line Clipping
• Area Clipping (Polygon)
• Curve Clipping
• Text Clipping
• Exterior Clipping
03/02/2025 17
Point Clipping
• Point Clipping is used to
determining, whether the
point is inside the window or
not. For this following
conditions are checked.
xwmin ≤ x ≤ xwmax
Ywmin ≤ Y ≤ Ywmax
• The (x, y) is coordinate of the
point. If anyone from the
above inequalities is false,
then the point will fall outside
the window and will not be
considered to be visible.
03/02/2025 18
Text Clipping
03/02/2025 24
LINE CLIPPING & POLYGON CLIPPING
ALGORITHMS
• Line clipping algorithms:
– Cohen–Sutherland
– Liang–Barsky
– Nicholl–Lee–Nicholl
03/02/2025 25
COHEN-SUTHERLAND LINE CLIPPING ALGORITHM
03/02/2025 26
Bit 4, Bit 3, Bit 2, Bit 1 =
Top, Bottom, Right, Left.
1 0 0 1
Pseudocode
Pseudocode
COHEN-SUTHERLAND LINE CLIPPING ALGORITHM
For P1(150,150):
For P2(400,300):
03/02/2025 31
Intersection Point
• Region code of P1 is 0000.
• Region code of P2 is 1010.
COHEN-SUTHERLAND LINE CLIPPING ALGORITHM
x = x1 + ( yboundary - y1) / m
Where yboundary is set either to ymin or ymax
m= (y1-y0) / (x1-x0)
Therefore,
m = (300-150) / ( 400-150) = 0.6
x = x1 + ( yboundary - y1) / m
Therefore,
x = 400 + (200 – 300) / 0.6 = 233
Here, yboundary is the Ymax,
Therefore, the intersection point is,
(x, ymax) =(233, 200)
03/02/2025 33
COHEN-SUTHERLAND LINE CLIPPING ALGORITHM
03/02/2025 34
Example 2
Example 2
Example 2
Example 2
Example 2
Pseudocode
Example 2
Example 2
Thank You
SUTHERLAND HODGEMAN POLYGON CLIPPING ALGORITHM
03/02/2025 44