570/761 Programming Assignment 1
Due: Tuesday, September 21, 2004
The purpose of this programming assignment is to get introduce you to
graphics programming with OpenGL and to increase your understanding of the
Bresenham line (Hearn, p. 95) and polygon filling (Hearn, p. 196) algorithms
discussed in class.
You are to modify the routines in drawLine.c and drawPolygon.c which are
paint.c, lineTest.c and polygonTest.c
so that they use only the OpenGL routine to draw a point, rather than those for
drawing lines or polygons. You are required to implement these using
the Bresenham line algorithm
and the polygon fill algorithm discussed in class and in your textbook.
The paint program is already set up to take user input and use it to draw points, lines, line loops, and filled polygons. So, you do not need to create any
new output, you just need to make sure that drawLine and
drawPolygon function properly.
- I should be able to compile and execute your final product on a Sun workstation!
(/usr/local/pub/ncs/graphics/OpenGL/Lab1/) for source code for
Makefile. The directory also includes two other testing programs:
as well as pseudo code for
What to submit
You are to submit a directory called lab1dir using the
submit -v ncs-grd cg1lab1 lab1dir
where lab1dir contains your funcions drawLine.c and
drawPolygon.c and a Readme file, if pertinent. If
you are using C++ and have changed file names for the test files, please also
include the testfiles, a Readme AND your makefile.
- You are expected expected to use the names Readme, lab1dir, drawLine.c and drawPolygon.c as specified above. As I am using scripts to
help with the grading process, failure to do so is annoying and you will be
suitably awarded! :-)
- Your directory should only include the source files and a Readme file, i.e., please remove any backup
files, executables, etc. before submitting. If you are using C++, please include ALL source files, a Readme file AND your makefile in the directory.
Your overall programming assignment grade will be based on the following:
Does your drawLine routine handle all kinds of lines
(shallow or steep/positive or negative slopes, vertical, diagonal,
or horizontal lines), starting from either endpoint?
Does your drawPolygon routine fill rectangles and triangles properly,
regardless of order of entry of vertices?
The gradesheet I will use can be viewed
When I begin grading your submittal, if there are any problems,
I will send you e-mail and you must then resubmit within 24
hours. Incorrect submittals are subject to penalties!
Nan C. Schaller
Rochester Institute of Technology
Computer Science Department
102 Lomb Memorial Dr.
Rochester, NY 14623-5608
September 8, 2004