570/761 Programming Assignment 2
Due: Friday, October 8, 2004
The purpose of this programming assignment is to provide
- experience in using a graphics package (OpenGL),
- an understanding of 2D primitives and attributes,
- an understanding of 2D clipping,
- an understanding of the window to viewport transformation, and
- an understanding of callback functions.
You are to write an application program which MINIMALLY uses the
OpenGL API to try the following (MINIMALLY = all of the following):
|Effect||OpenGL commands needed|
|OpenGl Setup|| glutInit, glutInitDisplayMode, glutInitWindowSize,
glutInitWindowPosition, glutCreateWindow, glutMainLoop, glutDisplayFunc, glClearColor, glFlush or glSwapBuffers
| Using different primitives (lines, line-strip, line-loop, triangles,
triangle-strip, triangle-fan, rectangle, quads, quad-strip, polygon)
|| glBegin/glEnd, glVertex, glRect|
|Using different attributes (line style, line width, fill style, color)
||glLineStiple, glLineWidth, glPolygonStiple, glColor, glEnable
|Using different window-to-viewport transformations, and the resulting
clipping, scaling, potential change in aspect ratio
||glViewport, glMatrixMode(GL_PROJECTION), glLoadIdentity, glOrtho or
|Moving from one screen to the next||glutMouseFunc, glutPostRedisplay
What you "draw" is up to you, but I would anticipate several different
screens that I can move between by pressing a mouse button, i.e.,
your image(s) should stay visible on the screen
until either mouse button is pressed and released. Your image(s) should
also be interesting!
- You are expected to use EACH of the routines mentioned above.
- You are expected to use the window-to-viewport transformations
to constuct an original image composed of a variety of pieces, i.e.,
such as that shown in class using DrawWorld();
- Example source files are available in my public directory
- "Best Of" selections from previous quarters are available for your
viewing from the course page http://www.cs.rit.edu/~ncs/Courses/570.shtml.
You'll need to copy the executable into your Unix account to run them.
I will select the "best" of your submittals to add to the web page and for use
in future demonstrations.
What to submit
You are to submit a directory called lab2dir using the
submit -v ncs-grd cg1lab2 lab2dir
where lab2dir contains your application program lab2.c, a
Readme file, if pertinent, and a makefile.
I should be able to type
to compile your application program's source file(s) and create
a UNIX executable lab2, which is to be created by linking your
application program with the OpenGL and GLUT libraries.
If you choose to use C++, instead of C, please be sure to include a
Makefile which has been modified to meet the specifications above.
- You are expected expected to use the names Readme, lab2dir, and lab2 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! :-)
- You are expected to include a Makefile and it should
function as specified above.
- Your directory should only include the source files, any header files that
you have created, a Readme file and a Makefile, i.e., please remove any backup
files, executables, etc. before submitting.
Your overall programming assignment grade will be based on the following:
demonstration of the use of the required routines, the complexity
(how interesting) of graphical output, internal documentation, and program
design. 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
August 25, 2004