Showing posts with label algorithm. Show all posts
Showing posts with label algorithm. Show all posts

Wednesday, 27 April 2011

Sutherland-Hodgman Polygon Clipping

Sutherland-Hodgman Polygon Clipping

Sutherland-Hodgman Polygon Clipping



1-The Sutherland-Hodgman polygon clipping algorithm clips polygons against convex clipping windows.
2-It does so by clipping the subject polygon against each clip edge producing intermediate subject polygons.
3-The Sutherland-Hodgman may produce connecting lines that were not in the original polygon. When the subject polygon is concave (not convex) these connecting lines may be undesirable artifacts.

2D Raster Algorithms

1-DDA Algorithm
The digital differential analyzer (DDA) samples the line at unit intervals in one coordinate corresponding integer values nearest the line path of the other coordinate.
Major deficiency in the above approach :
   1-Uses floats
   2-Has rounding operations

2-Bresenham’s Line drawing Algo
An accurate, efficient raster line drawing algorithm  developed by Bresenham, scan converts lines using only incremental integer calculations that can be adapted to display circles and other curves.