








































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!









































Lines are a very common primitive and supported by almost all graphics packages. lines form the basis of more complex primitives such as polylines (a connected sequence of straight-line segments) or polygons. There are two line-drawing algorithms DDA algorithm and Bresenham’s algorithm.
The DDA algorithm is simple and easy to implement, but it does involve floating point operations to calculate each new point. Floating point operations are time-consuming when compared to integer operations. Line drawing is a very common operation in computer graphics, it would be nice if we could devise a faster algorithm which uses integer operations only.
Bresenham’s line-drawing algorithm provides significant improvements in efficiency over the DDA algorithm. The improvements arise from the observation that for any given line, if we know the previous pixel location, we only have a choice of 2 locations for the next pixel.
The most common type of primitive in 3-D computer graphics is the fill-area primitive. The term fill-area primitive refers to any enclosed boundary that can be filled with a solid colour or pattern. However, fill-area primitives are normally polygons , as they can be filled more efficiently by graphics packages. Polygons are 2-D shapes whose boundary is formed by any number of connected straight-line segments.