Last Updated
February 22, 2010
Line Drawing
- Describe a line drawing algorithm that draws a dot-dash line in some pattern. The pattern is supplied as a string of 0’s and 1’s. For example a pattern such as 00111111 indicates a dash is off for two pixels and on for six.
- Using your algorithm above, describe how you would continue the pattern while drawing the boundary of a polygon. That is the pattern is to continue seamlessly from one polygon edge to the next.
- Describe an efficient method of line drawing on a raster device.
- Describe an efficient method of circle drawing on a raster device.
Bresenham Line Drawing
- Bresenhams algorithim uses an iterative term, Ti+1, the value of which is used to determine the position of the subsequent pixel. How is this term derived ?
- Outline in detail Bresenham’s line algorithm for the special case where the slope of the line is between 0 and 1. You should show how the term variable is derived. Show how to iterate on the term variable.
- Describe how you would draw the following sets of line with bresenham
- Lines with a slope greater than 1.
- Lines with a negative slope.
© Ken Power 1996-2016