Name: Jenny Qing Qian Username: l9p5 By submitting this file, I herby declare that I worked individually on this assignment and that I am the only author of this code. I have listed all external resources (web pages, books) used below. I have listed all people with whom I have had significant discussions about the project below. Command line parameters: Starting the program without command line parameters displays a single mouse. Starting the program with a command line parameter displays two mice (one initially hidden) and various other objects in a background scene (the "scene view"). Style: An object-oriented programming approach was employed for this project. Each logic unit was implemented as a separate class, such as different parts of the mouse and the basic drawing objects as well as the animators used to perform various animations. Modelling: The drawCube() function is implemented in the Cube.cpp class as Cube::_draw(). The unit cube is created out of six square faces. The mouse is modeled out of transformed cubes. A mouse object is composed of two-prism objects (as the Body), a Head object, four-Paw objects and one-Tail objects. A Head object (Head.cpp). contains three-Whisker objects, one Prism object (as the neck), one cone object (as the face and the pointed nose), two smaller cubes (as the eyes) and two bigger cubes (as the ears). A Paw object is made of two elongated cubes, one as the leg and the other as the paw. The tail object is made of num_segments (8) long-skinny cubes decreasing in size along the positive x-axis. The mouse is created using a hierarchical scene graph structure: a relative transformation is used to position an object. For instance, the head was drawn relative to the front segment of the body; back legs were drawn relative to the back of the body where the body hinges on situp; front legs were drawn relative to the front segment of the body; whiskers were drawn relative to the head; tail was drawn relative to the back end of the body; and each segment of the tail was drawn relative to the previous segment. Extra credit (worth 2 pts): 1) extra geometric detail: To give the mouse a smooth body, the body is modeled with two prisms. A prism is made from 4 cubes that is in 45-degree angle from one another. This is implemented in the Prism.cpp. To model a pointed mouse face, a cone is used. A cone is made from a stack of 20 prisms decreasing in size along the negative x-axis. A prism (as the neck) was inserted between the pointed mouse face and its body, so that when the mouse nods its head, the head and the body are still completely connected. 2) color: The coloring of the mouse was inspired by the famous German TV cartoon mouse (http://www.wdrmaus.de). The body and head are colored in brown and the ears, whiskers, legs, paws and tails are colored in dark brown; the eyes are colored in black. The background is colored in blue. Animation: Animators are in general triggered (trigger methods) by keystrokes, upon which they become active. Each time the idle function is called, key-activated animatiors will be stepped. Finally most animators will stop at some point. Each animator will be queried by an 'ismoving()' method, which returns true as long as the animator is running. The most important animator is the toggle animator. The toggle animator maintains a current floating point value, the minimum and maximum value and the step-size. In one-step (jumpcut) animation mode, the animation toggles between the minimum and maximum values. In smooth mode, each time the animator steps, the current value steps by the specified step-size, until it reaches the maximum or minimum value. Next time, when the animator gets triggered by the keystroke again, it moves in the reverse direction. The speed and smoothness of the animation can be controlled by the step-size. Finally, the various objects' draw methods query the current value of the animator, which corresponds to the actual position or rotation angle of the animated object. There are other types of animators that will be described below. The animator manager keeps a look-up table for all the key-animator relations, it also keeps track of currently active animators. Finally, it also keeps track of the mode of the specific animation (jumpcut or smooth). Thanks to the animator manager, the idle callback and the keyboard callback need not mention individual animators directly, instead, they can just call suitable methods in the animator manager, which makes for cleaner code. The individual animations implemented are: Head nod, Leg raise, Whisker wiggle, Sit up, Tail curl, Jumpcut and Smooth transition, extra credits (worth 3 points): Interaction: 'h' - head nod 'l' - front left leg raise 'm' - front right leg raise 'n' - rear left leg raise 'o' - rear right leg raise 'w' - whisker wiggle 's' - sit up 't' - tail curl ' ' - toggles between jumpcut mode and smooth transition mode. - Camera motion: The original keys for changing the view have been re-assigned to allow smooth camera motion, with the following meanings: 'p','f': rotate camera around x axis 'b','a': rotate camera around y axis 'u','r': rotate camera around z axis '>': zoom into scene '<': zoom out of scene These keys act as toggles: the first stroke starts the motion, the second stroke ends it. - Mouse walking: A walking motion is implemented using the MotionAnimator class. It can be controlled using the following keys: 'g' start/stop leg movement '[' accelerate '/' decelerate ';' turn left ''' turn right While the walking motion is ongoing, the keystrokes for the leg raise animators are disabled. The mouse walking motion works best in the "scene view". - Mouse trap: These keys can be combined to create an animation of the mouse trap catching a mouse: 'c' lower the wooden block that releases the trap latch 'C' snap the trap 'x' kill the mouse. (This leads to a 3/4 separation of the head from the body upon hitting the 'h' (head nod) key. - Second mouse: The scene view displays a second mouse, whose animations work just as for the first mouse. They are triggered using the same keys, while holding the Shift key. - Other keys '0' - reset all animations 'y' - dim or brighten the light '+','-' - adjust the speed of all animations, for use on slower or faster computers. Images: In total, 6 images are submitted: frontview.png, sideview.png, topview.png, situp.png, walking.png, headnod.png. Movie: The movie is stored as anim.gif. It shows an animated scene.