Kevin Harris
CS431: Introduction to Computer Graphics
University of Utah
Fall 1997
Program #1
Class Handout
My implementation See a working version below. Note that I
have not checked this implementation for bugs since the class ended. There may be some
bugs that I didn't find back then (4 years ago).
Notes:
- This was my first real Java program. The first day of this class,
Pete Shirley told us that we had a test the next class period and
that we had 1 week to learn Java and turn in our first assignment.
What a great way to weed out the people who aren't committed. :)
- All entries into textfields must be accompanied by an Enter or Return
- For delay and speed, bigger numbers make it rotate slower
- The speed is the number of divisions per complete rotation (int)
- Verticies must be a number >1
- My additions (not required):
- Star/Poly:
Because it is difficult to see rotation in shapes with a larger
number of verticies, I have introduced a 'star' option that will
connect each vertex to every other vertex. This makes a form of a
'star' pattern and makes it easier to see rotation than the wobbly
edges of something that looks like a circle. The Poly option will
connect every vertex to it's adjacent verticies.
- Speed/Delay controls:
I could not find a speed that matched the demo, so I added controls
to allow the user to select his/her own rotational 'speed' and
delay between each drawing of the polygon (in ms).