Final Project - CSE 167 - Student: Cantus Chang

Comments

This project started off initially as just a gumball machine that dispenses a gumball of random color on command. It has some transparent parts: the midsection where you can watch the gumball roll down a spiral, and the sphere that contains all of the gumballs. The amount of gumballs in the sphere never actually decreases because that would be very hard to implement, but I was able to get random colors for the gumballs. Building the gumball machine wasn't too hard, but achieving the desired animation was tougher. If you press 'g', the crank turns 180 degrees and a gumball rolls out and down the spiral. It remains at the bottom until you press 'g' again, and then it disappears while another gumball falls.

Many of the same commands remain from previous projects--toggling the light, wireframe mode, smooth/flat shading, and directional/positional lighting on or off. There is also control over the viewpoint and rate of movement.

I added the grass texture mapping and sky blue background. This made the gumball machine seem kind of lonely, so I decided to add the Anna Kournikova component. She is always facing the direction of the viewer, i.e. the quad she's on is rotating as the viewer moves. It was somewhat challenging making parts of the texture map transparent, but I got it to work with help from the TAs. I used photoshop to extract the image onto a red background, and then load the image so that the red background would have an alpha value of zero to make it transparent. I'd say Anna's looking pretty good.

Arrow keys control viewpoint.
Press "g" to turn the crank and get a gumball.
Press "l" to toggle the light source on/off.
Press "h" to toggle between (a)positional lighting and local viewing, and (b)directional lighting and non-local viewing.
Press "w" to toggle wireframe mode.
Press "R" or "r" to increase or decrease rate of movement (respectively).
Press "s" to toggle between flat and smooth shading.

List of figures