Clipping in Computer Graphics

This article is about Clipping in computer graphics. In this article, we will briefly study what Clipping is and what are the types of clipping? We will also be studying the various conditions where we feel the need to perform clipping in computer graphics.
Submitted by Monika Sharma, on October 10, 2020

While transforming a window port to a viewport, there may occur conditions where the aspect ratio of both the ports are alike. In such situations, we need to modify the captured window to fit it in the viewport. Sometimes we need to show a large portion of the picture, sometimes only some specific parts. In such cases, not only scaling & translation is necessary, as the visible part of the picture is also identified by these methods. So, this process is not as easy as it appears to be. Hence, to achieve this, we perform clipping on the window port.

The mapping of the window port to the viewport can be thought as of placing a frame over a picture where the frame is out of viewport and the picture is the window. If the picture is larger than the frame, then certain parts of the image lie inside, while others are partially inside and some lie completely outside the frame. Thus, the lines or elements which are outside the frame cannot be fitted into it. Thus we cut them off to fit the picture into the frame. In the same manner, in computer graphics, we perform clipping.

Conditions that occur while viewing transformation

There are three conditions that may occur while performing window to view port transformation:

Case 1: A simple line or lines entirely lie inside the window. Such lines are considered as visible lines.

clipping (1)

Case 2: A simple line lies entirely outside the window. Such lines are considered as invisible lines.

clipping (2)

Case 3: A simple line partially lies inside the window and partially outside. In such conditions, we need to perform clipping. Thus, the clipping point of the intersection of a line with the window is determined.

clipping (3)

So, for deciding the visible and invisible portion from the picture, clipping is performed on it. Clipping determines each element into the visible and invisible portion by omitting the extra part. So, the visible portion is selected. And an invisible portion is discarded.

clipping (4)

The clipping can be performed either by hardware devices or by software devices. However, the clipping through hardware devices was used in earlier times. Nowadays, we use software clipping. The basic idea of clipping can be understood with the following diagram:

clipping (5)

Types of Clipping

The types of clipping are determined by the shape that is clipped. The following are the types of clipping.

  1. Point Clipping: Performed on a point
  2. Line Clipping: Performed on a line
  3. Area Clipping (Polygon): Performed on various types of polygons
  4. Curve Clipping: Performed on curved lines and shapes
  5. Text Clipping: Performed on texts.
  6. Exterior Clipping: Performed without knowing about the content of the image.

Applications of clipping

The clipping process finds its wide use in computer graphics. As we have already seen its very important and crucial role in the window to view port transformation, the following are some the areas in this process where the clipping finds its application:

  1. To extract the part of image that we desire.
  2. To identify the invisible and visible area in the 3D object plane.
  3. For enabling zooming feature in our screens.
  4. For creating objects using solid modeling.
  5. For drawing operations.
  6. To perform the operations related to the pointing of an object.
  7. To delete, copy, or move part of an object.

Comments and Discussions!

Load comments ↻

Copyright © 2024 All rights reserved.