[ This chapter does not appear in the book. ]
The penguin that dizzily moved in a circle in the previous chapter gets a chance to stand still in this chapter, but the exercise regime continues, with him having to raise and lower his flippers for several minutes. The picture above shows two shots of the penguin, one with his flippers up, the other down. At execution time, there's a smooth transition between these extremes.
The flipper movement is achieved through mesh morphing: a penguin base model (which has its flipper's extended horizontally) is gradually changed into an almost identical penguinUp target model (which has its flippers up). This is morphed back to the base shape, and then to a penguinDown target model (flippers down). From the down position, the penguin raises its flippers again by morphing back to the base case.
Although only one penguin is rendered to the screen, three penguin models are used in this application: the base version, a version with the flippers raised, and a version with the flippers lowered.
The other contribution of this example is a MobileCamera class, which allows the camera to be translated forwards, backwards, left, right, up, and down, and to be rotated around the y-axis (i.e. turned left or right), and about the x-axis (i.e. rotated forward or back). The picture on the right shows the camera moved up, left, and back, and rotated to look down towards the floor.
Details about the mobile camera are written to the top-left of the screen: its current mode (move, rotate, or float), and its position and orientation.
The MobileCamera class can be easily added to other applications to offer camera mobility. A modified version of it is the basis of the First Person Shooter (FPS) example in M3G Chapter 5.
Dr. Andrew Davison
Back to my home page