Ejemplo 1: Algoritmo de recorte de línea de Cohen Sutherland: En el algoritmo, en primer lugar, se detecta si la línea se encuentra dentro o fuera de la pantalla. Todas las líneas pertenecen a cualquiera de las siguientes categorías: Caso de recorte visible no visible
Cohen Sutherland Line Clipping Algorithm:
In the algorithm, first of all, it is detected whether line lies inside the screen or it is outside the screen. All lines come under any one of the following categories:
Visible
Not Visible
Clipping Case
Ejemplo 2: algoritmo de cohen sutherland
There are three possible cases for any given line.
Completely inside the given rectangle : Bitwise OR of region of two end points of line is 0 (Both points are inside the rectangle)
Completely outside the given rectangle : Both endpoints share at least one outside region which implies that the line does not cross the visible region. (bitwise AND of endpoints != 0).
Partially inside the window : Both endpoints are in different regions. In this case, the algorithm finds one of the two points that is outside the rectangular region. The intersection of the line from outside point and rectangular window becomes new corner point and the algorithm repeats
¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)