CG Notes Unit - Ii
CG Notes Unit - Ii
2D Viewing Pipeline:
This involves a series of transformations performed, right from creation, till the
object is finally seen or displayed at a position or a viewing region on a display device
like monitor. Each transformation step performed converts data from one coordinate
system to the other.
In viewport clipping, the whole of the contents from the world are brought to the viewport and
then clipping against the viewport. It is thus more convenient to perform clipping in the world
coordinate system.
Point clipping
Line clipping
Polygon Clipping
Text Clipping
Point Clipping:
In point clipping, points that are inside the rectangular region are selected for display and points
that are outside the region are discarded. Now the question is, how do we know whether a point
is inside or outside a given rectangular region? For this we should perform a test as shown.
Line Clipping:
It is performed by using the line clipping algorithm. The line clipping algorithms are:
1. Visible
2. Not Visible
3. Clipping Case
1. Visible: If a line lies within the window, i.e., both endpoints of the line lies within the
window. A line is visible and will be displayed as it is.
2. Not Visible: If a line lies outside the window it will be invisible and rejected. Such lines will
not display. If any one of the following inequalities is satisfied, then the line is considered
invisible. Let A (x1,y2) and B (x2,y2) are endpoints of line.
3. Clipping Case: If the line is neither visible case nor invisible case. It is considered to be
clipped case. First of all, the category of a line is found based on nine regions given below.
All nine regions are assigned codes. Each code is of 4 bits. If both endpoints of the line
have end bits zero, then the line is considered to be visible.
Advantage of Cohen Sutherland Line Clipping:
1. It calculates end-points very quickly and rejects and accepts lines quickly.
2. It can clip pictures much large than screen size.