Diese Präsentation wurde erfolgreich gemeldet.

Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
×

1 von 15 Anzeige

# Clipping

Clipping,Point Clipping,Line Clipping,Cohen-Sutherland Line Clippings,Polygon Clipping,Text Clipping
,Sutherland Hodgman Algorithm)

Clipping,Point Clipping,Line Clipping,Cohen-Sutherland Line Clippings,Polygon Clipping,Text Clipping
,Sutherland Hodgman Algorithm)

Anzeige
Anzeige

## Weitere Verwandte Inhalte

Anzeige

Anzeige

### Clipping

1. 1. Prof. Neeraj Bhargava Pooja Dixit Department of Computer Science School of Engineering & System Sciences MDS, University Ajmer, Rajasthan, India 1
2. 2.  Clipping Basics  Cohen-Sutherland Line Clipping  Clipping Polygons  Sutherland-Hodgman Clipping  Perspective Clipping 2
3. 3. 3  Clipping is a process that identifies those portions of a picture that are either inside or outside of a specified region or space is known as clipping.  Clip regions are commonly specified to improve render performance. A well-chosen clip allows the renderer to save time and energy by skipping clculations related to pixels that the user cannot seeworld coordinates Windowing I A scene is made up of a collection of objects specified in world coordinates View coordinates Windowing II When we display a scene only those objects within a particular window are displayed. world coordinates world coordinates WYmin WYmax WYmin WYmax WXmin WXmax WXmin WXmax Windowing III Because drawing things to a display takes time we clip everything outside the window
4. 4. 4  Consider an example in figure that shows which lines and points should be kept and which ones should be clipped.
5. 5.  What is Point Clipping?  Point clipping helps in identifying whether a particular point (X, Y) is within the window and accordingly take appropriate actions for using the coordinates of the window, either maximum or minimum.  If x satisfies that Wx1 ≤ X ≤ Wx2, then the coordinate X is inside the window, and if Y satisfies that Wy1 ≤ Y ≤ Wy2, then Y lies inside the window. 5
6. 6.  What is Line Clipping?  The part of the line inside the window is kept and the part of the line appearing outside is removed in Line Clipping.  Cohen-Sutherland Line Clippings  The clip window depicted below is used by this algorithm. 6
7. 7.  The entire region is divided by using 4-bits which represent Top, Bottom, Right, and Left of the region, As it is the TOP- LEFT corner, the TOP and LEFT bit is set to 1. 7
8. 8.  For the line, there are three different possibilities:  Line can be completely inside the window (This line should be accepted).  Line can be completely outside of the window (This line will be completely removed from the region).  Line can be partially inside the window (We will find intersection point and draw only that portion of line that is inside region). 8
9. 9.  Algorithm Step 1 – For each endpoints, a region code is assigned. Step 2 – The line is accepted if both endpoints have a region code 0000. Step 3 − Else, the logical AND operation is performed for both region codes. Step 3.1 − If the result is not 0000, then reject the line. Step 3.2 − Else clipping is required. Step 3.2.1 − An endpoint of the line is selected that is outside the window. Step 3.2.2 − Find the intersection point at the window boundary (base on region code). Step 3.2.3 – The endpoint is replaced with the intersection point and the region code is updated. Step 3.2.4 − Repeat step 2 until we find a clipped line either trivially accepted or trivially rejected. Step 4 − Repeat step 1 for other lines. 9
10. 10.  What is Polygon Clipping (Sutherland Hodgman Algorithm)?  Against the edges of the clipping window, the vertices of the polygon are clipped by using Sutherland Hodman Algorithm.  New vertices of the polygon are obtained by clipping the left edge of the polygon window. The polygon is clipped against right edge by using the new vertices as depicted below. 10
11. 11.  If the edge is not completely inside the clipping window, an intersection point appears. The portion that is outside is clipped as depicted below: 11
12. 12.  What is Text Clipping?  Text clipping can be provided in computer graphics by using different techniques. The characters are generated and the requirements of a particular application. Text clipping can be done in three different methods:  All or none string clipping  All or none character clipping  Text clipping  All or none string clipping is depicted below: 12
13. 13.  Under this method, either the entire string is kept or the entire string is rejected. From the above figure, STRING2 is entirely inside the clipping window and so it is kept and STRING1 is rejected as it is partially inside the window.  The following figure shows all or none character clipping − 13
14. 14.  It is based on characters rather than on entire string. The string that is inside the clipping window is kept, and if the string is outside the window then:  The portion of the string outside the window is rejected  The entire character is discarded if the character is on the boundary of the clipping window.  Text clipping is depicted below: 14
15. 15.  This method depends on characters method than on the entire string method. The string that is inside the clipping window is kept and the string that is partially outside the window:  The portion of the string outside the window is rejected.  The portion of the character that is outside of the clipping window is discarded, if the character is on the boundary of the clipping window. 15