Posts

Showing posts from May, 2021

Assignment 5 (Sutherland polygon clipping)

Image
Aim:  Implement Cohen Sutherland polygon clipping method to clip the polygon with respect the view-port and window. Use mouse click, keyboard interface Theory:  Line Clipping – Cohen Sutherland   In computer graphics, ' line clipping' is the process of removing lines or portions of lines outside of an area of interest. Typically, any line or part thereof which is outside of the viewing area is removed. The Cohen–Sutherland algorithm is a computer graphics algorithm used for line clipping. The algorithm divides a two-dimensional space into 9 regions (or a three-dimensional space into 27 regions), and then efficiently determines the lines and portions of lines that are visible in the center region of interest (the viewport). The algorithm was developed in 1967 during flight simulator work by Danny Cohen and Ivan Sutherland The design stage includes, excludes or partially includes the line based on where: Both endpoints are in the viewport region (bitwise OR...