Define following terms:
- Windowing: Windowing is the technique of selecting a portion of a real-world scene to display on a screen.
- Clipping: Clipping is the process of determining and eliminating the piece of an item that is outside of the clipping window.
- Clipping window: The rectangular window against which the visibility of scene objects is checked is known as the clipping window.
- Window: The visible region of the scene inside the clipping window is displayed on some device. More formally, the world coordinate area which is selected for display is called a window.
- Viewport: An area on display device to which window is mapped is called viewport
- Window to view port transformation: The process of mapping the part of world coordinate scene to device coordinate is referred to as a viewing transformation or window to viewport transformation or windowing transformation
Discuss the methods for clipping the primitives
Clipping the primitives can be accomplished in two ways:
- Scan conversion approach: The visibility of each pixel of an item is examined in this approach, and the pixel is drawn if it is visible. In other words, we clip the item during the scan conversion process. This method is straightforward, however it does large calculations.
- Analytical technique: In this approach, the visible component of the primitives is determined analytically before scanning the object. This method does not execute the pixel-by-pixel verification. It shortens the computation, but it is complicated.
State the steps for window to viewport transformation
How can you obtain the zoom in and zoom out effect on your monitor screen?
To achieve the zoom effect, we will map different-sized windows onto a fixed-size viewport. When the window size is reduced, we get a zoom in effect, and when the window size is increased, we get a zoom out effect.
What is panning?
Panning is accomplished by dragging a fixed-size window over various locations in the scene.
State the taxonomy of 2D Clipping.
What is point clipping?
Point clipping is a basic process. It’s a simple matter of acceptance or rejection. The point can be completely inside or completely outside of the clipping region. Inside is the point on the clipping window’s boundary.
Let (Xmin, Ymin ) and (Xmax, ymax ) represent the clipping window’s lower-left and top-right corners, respectively.
Point (x, y) is within the region only if the following four inequalities hold true:
Xmin ≤ x ≤ Xmax
Ymin ≤ y ≤ Ymax
All four conditions must be met for the point to be inside the clipping window. The point lies outside the clipping rectangle if any of the four inequalities does not hold.
Explain the process of region code / out code generation in Cohen-Sutherland Line clipping algorithm
Outcode is represented as a four-bit number. If the conditions given in following figure are met for a particular bit, the value of this bit is set to 1.
The outcode is set at any endpoint (x, y) of a line based on the following conditions:
For any endpoint (x, y) of a line, the outcode is set according to the following conditions :
- Set first bit (most significant bit) if a point lies above window i.e. y > Ymax.
- Set second bit if a point lies below window i.e. y < Ymin.
- Set third bit if a point lies to the right of window i.e. x > Xmax.
- Set fourth bit (least significant bit) if a point lies to left of window i.e. x < Xmin.
If the point is inside the clipping window, none of the above conditions would be true. So, outcode of endpoint inside the clipping region would be 0000.
State pros and cons of Cohen-Sutherland line clipping algorithm
- It is simple to learn and apply.
- It is best suited for lines that are totally inside or outside.
- It can easily be extended for 3D line clipping.
- Clipping is costly when done repeatedly.
- This only applies to rectangular clipping windows. It is incapable of handling any other shape.
- It can be improved by including more regions (e.g. Nichol Lee Nichol approach).
Scholarly Article: 3D line clipping algorithms – Comparative analysis. Click to read.