|
CS 371 Computer Graphics Spring 2005
|
|
Due by BEGINNING OF CLASS on 5/6/05
- Problem 1
- Required:
The text and class notes provide a complete description
(derivation of all relevant quantities, plus code)
of the case of Bresenham's line drawing algorithm for segments
((xL,yL),(xR,yR)) with xL < xR and having slope
m, 0 <= m <= 1. Provide a complete description of the case of
Bresenham's algorithm in which xL < xR and the slope m
satisfies -1 <= m <= 0 (so, in particular, yL >= yR).
- Problem 2
- Challenge problem for extra credit:
Develop an algorithm in the spirit of Bresenham's algorithm for circles.
You need only consider a circle of integer radius R centered at the origin.
Focus your attention on the portion of the circle corresponding to angles
between 45-90 degrees counter-clockwise of the positive x-axis. On this
part of the circle, there should be exactly one pixel for each x-value.
Can you get rid of all floating-point operations? How many additions
and multiplications does your algorithm require?
lenhart@cs.williams.edu