Saltar al contenido

ejemplo de código c del algoritmo de recorte de línea cohen sutherland

Presta atención ya que en este tutorial vas a encontrar el resultado que buscas.

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: Visible No visible Caso de recorte

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

Sección de Reseñas y Valoraciones

Si para ti ha sido de utilidad nuestro artículo, agradeceríamos que lo compartas con más seniors y nos ayudes a extender nuestro contenido.

¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)



Utiliza Nuestro Buscador

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *