
CMSI 370
IN T E R A C T I O N DE S I G N
Fall 2007
Assignment 1206
Sorry to pile on this one more task, but I think we need to get over this hump so that we don’t have to deal
with it anymore next semester. Should be fairly simple though: type, tweak, run, and commit. 1 hour tops.
For Submission
Get your hands dirty with OpenGL — take the
spinningsquare.cpp program and make the following
changes to it:
1. Change the object being drawn. Go on, be crea-
tive, knock yourself out.
2. Change the way spinning is toggled: instead of a
mouse click, use the keyboard. Hint: you’ll need
to use glutKeyboardFunc() instead of glutMouse-
Func(), and the function you pass should have
signature void func(unsigned char key, int x, int y).
3. Change the title, initial size, and initial location
of the window.
Commit this, your OpenGL program, under
/homework/cmsi370/spinningshape.
Extra Credit
Just in case you’re a little inspired (and to give you
one more opportunity to pad your homework
grade), a little advanced reading in OpenGL will
allow you to make the following additional changes
to the program. Do them all to get extra credit:
1. Change the axis of the object’s rotation (the
sample version rotates around the z axis).
2. Implement the following keyboard controls (and
their corresponding functions):
a. + and – increase and decrease the rate of
rotation, respectively.
b. [ and ] decrease and increase the frame rate
of the animation.
c. The C key changes the object’s color (or
color scheme, in case you figured out how to
draw objects with multiple colors).
d. The S key changes the object being drawn
(i.e., rotate among 2 or more different ob-
jects as the user hits the S key).
Just include these features in /homework/cmsi370/
spinningshape; I’ll look for them when I go through
your code.