We continue the First Person Shooter (FPS) theme of the previous chapter, but without the shooting! Instead the emphasis is on navigation through a complex scene (a 3D maze). The two main topics will be how to generate a realistic looking scene (realistic in the "Doom" or "Quake" sense), and how to use multiple views to aid navigation.
The image shows a screenshot of the application, Maze3D, which consists of three JPanels. The left hand side shows the user's viewpoint facing forwards (we sometimes call this the main camera), the top right hand panel is the view behind the user (the back facing camera), and the bottom right hand panel is a schematic overview of the entire maze with the user represented by an arrow pointing in his/her current forward direction. We call this the bird's eye view.
As in the last chapter, navigation is controlled from the keyboard: the user can move forwards, backwards, left, right, up, or down, but can not move through walls or the floor. Rotation is limited to 90 degree turns to the left or right.
The maze layout (or plan) is generated by a separate application, which stores it as an ASCII file, and is read in by Maze3D at start-time.