Test#2: Open-book programming test.

 

1.     No collaboration with others online or not during the test.

2.     You can use your own code and/or adapt code from the book, but you are not allowed to borrow code from the internet.

 

1.     Basic geometric modeling: Write a bus function that (i) models the bus using geometric primitives and/or basic objects provided by glu and/or glutcan and (ii) renders the bus centered at the origin if no model-view transformation is applied when it is rendered. For example, you can model the bus in terms of (i) a scaled cube as the body, (ii) one torus for each wheel, and (iii) a rectangle for each of the windows, the front lights, the brake lights, and the plates.

2.     Animation through model-view transformation: Use model-view transformation appropriately together with the bus function to create the animation of the bus moving around a fixed point (0, 0, -4) in a circle with a radius 2.

3.     Lighting: Model two light sources. The first one is statically located at (0, 4, 4) that is behind and above the static camera. The second one is attached to the front of the bus and thus this light source should dynamically move as the bus moves to light up the environment.

4.     Set up a menu: Set up an attached menu such that the user can turn each of two light sources on or off independently by right clicking the mouse and select a menu item.

5.     Materials: Set up additional subjects in the scene, including at least (i) a couple static buses (by using the bus function together with model-view transformation) parking nearby at different locations with different orientations and (ii) things about the grounds and around. Set up the material properties differently for these subjects to render different the visual effects.

 

 

1.     Add a bus spiraling downward to the ground level: See the picture here. Add an additional bus spiraling downward toward the ground level at the bottom where the first bus in Part I is located. Note that this is very similar to what you have done in part I. Descending downward, the Y coordinate of the center keep decreasing in a fixed rate. You also need to tilt the bus in some angle downward when it descends (or upward when it ascends), reflecting the slope of the road downward (or upward). But otherwise the movement along X and Z is still a circular movement (and you can choose to make the radius fixed or make it decreasing as the bus descends downward.).

2.     Spot light: Fine-tune the setup of your second light source such that it’s effect looks like some spotlight here and you can feel that (as the bus associated with the 2nd light source moves) the light source dynamically moves to light up the nearby neighborhood.

3.     Metal materials: Fine-tune your material setup such that the buses are of different colors but all look like metals.

 

 

·       1st submission: By the end of the class, submit the source code file(s) and your test report under Canvas to show what you are able to accomplish in 75 minutes.

·       2nd submission: By 11:50pm Thursday 04/02/2015, submit the final version of the source code file(s) and your test report under Canvas to show what you are able to accomplish in the end.