This midterm exam is due on October 27 by the end of class time. It may
be submitted on paper or electronicly, but WILL NOT BE ACCEPTED after the
end of class on the 27th.
You are expected to work by yourself on this exam. You may use your notes,
your book, and any other written or electronic material, but you may not
discuss these questions with any person other than your instructor.
Please answer each question carefully and completely.
- What are the worst and best case time performance for the two fill
algorithms discussed? Give an example of the best and worst for each.
Discuss the space complexity of each algorithm.
- Describe and diagram the graphics transformation pipeline. Label all
parts, and show how the elements are translated from one to another. Include
in your discussion/diagram as many of the topics covered in the book and in
class as possible.
- Present c code to implement a parallel version of Bresenham's line
algorithm. Discuss the speedup your code represents. You may assume any
parallel architecture you wish. If you are not familiar with parallel
programming, please see your instructor.
- Develop and implement a line attribute Random. The line drawn should
maintain all standard line properties other than smoothness. Be sure to
describe and discuss attribute setting functions for this attribute.
---------------------------------- NORMAL LINE
___ ____
/ \ / \
--- \ /\ / ------ RANDOM LINE
------ ----
- Write a program which, given two opposite corners of a rectangle will
produce an input file for our graphics project that makes the rectangle appear
to roll across the screen. The rectangle has one non-connected corner, which
should "flap" as the rectangle rolls. You may assume the command
color c
has been implemented. This command sets the current drawing color to
c where 1 = white and 0 = black.
An the motion of the rectangle may be:
/\
+---+ / \ ----+ ----+ +----+
| | -> / / -> | -> \ | -> | |
| | / | \ | | |
---+ ----+ -----+----+ +----+ +----+
The motion need not be correct according to the laws of physics, it is
sufficient to simply show correct transformations of the object.