Design, implement, and exercise the application below.
Model a fair approximation to one of the world's great architectural buildings. A castle provides a good choice, but you can instead choose to do some other building such as the Taj Mahal, the Parthenon, the Horyuji temple at Nara, the Forbideen City at Beijing, San Vitale at Ravenna, the Dome of the Rock in Jerusalem, the Chateua of Fontainebleu, etc.
Your model should have features like walls, towers, arches, windows, and roofs. Be sure it has at least one rounded arch. It should appear solid from any viewpoint. Use interesting material properties for its various features (as discussed in class) so that it has an interesting appearance when bathed in light. Provide at least one light source in its vicintiy.
In some central area or room in the building there is an interesting "tube", as discussed in class, that floats in the center of the area and rotates on its own.
The user browses through and around this scene with a camera that is controlled by mouse clicks and keystrokes. Give your browser the functionality similar to that of a VRML browser (Have a look at VrmLab for an example. Perhaps download a VRML browser and get some practice navigating VRML scenes.)
Be sure to include at least the following navigation modes:
'g': go: The mouse is placed anywhere on the screen and the left button is pressed. This establishes a pivot point, which is visible as a small cross. As the mouse is moved above the pivot the camera moves forward along its n-axis. The speed of motion is proportional to the vertical distance of the mouse above the pivot. Similarly, if the mouse is moved below the pivot, the camera moves back along its n-axis. If the mouse is moved to the left (or right) of the pivot, the camera rotates about its v-axis to the left (or right), with a speed proportional to the horizontal distance of the mouse from the pivot.
's': slide: The mouse is placed to set a pivot point as in the go mode. When the mouse is moved (with the button down) to the left or right, the camera slides along its u-axis, left or right, with a speed proportional to the horizontal distance of the mouse from the pivot. Similarly, when the mouse is moved above or below the pivot, the camera slides along its v-axis with a speed proportional to the vertical distance of the mouse from the pivot..
't': tilt: The mouse is placed to set a pivot point as in the go mode. When the mouse is moved (with the button down) to the left or right, the camera rotates about its v-axis to the left (or right), to an angle proportional to the horizontal mouse distance from the pivot. Similarly, when the mouse is moved above or below the pivot, the camera rotates about its u-axis, through an angle proportional to the vertical mouse distance from the pivot..
'r':rotate: Same mouse pivot and positioning as in the modes above. In this mode the camera doesn't change: instead the whole scene rotates about its center point. For up-down mouse motion it rotates about an axis parallel to the camera's u-axis; for left-right mouse motion it rotates about an axis parallel to the camera's v-axis.
'1', '2', '3', '4': At least four preset camera positions and orientations. Pressing these keys immedaitely sets the camera to these specified positions. One of these positions is a point inside your building just in front of the rotating tube, providing a good look at it.
'p': point: left click any point in the scene and the camera
moves some fixed distance towards it, centering the clicked point in the
camera view.
'm': minor's lamp: this toggles on or off a bright spotlight
situated at the camera's eye, pointing along the n-axis.