Various viewpoint manipulations are carried out by
The viewpoint's position is specified using the maze's starting point (represented by an
s in the maze plan). The viewpoint is rotated to face along the positive z-axis. There's no reason for doing this, except to show how I can change the default orientation (which is along the negative z-axis).
KeyBehavior object is connected to the viewpoint so key presses can move it during execution.
The maze is cast into stygian gloom, so a
Spotlight node is connected to the viewpoint to help the users see what they're doing. It'll move with the viewpoint, giving the impression that the player is holding a spotlight.
The FOV is widened, so the user can see more of the scene in front of them. The front and back clip distances are adjusted, primarily so the user can move right up to a block or cylinder without it being clipped.
Many first-person games include a player avatar (a visible representation of the user, or part of the user); the "gun-in-hand" image in Chapter 24 is a simple example. I've decided not to include an avatar in the
Maze3D application, but I'll discuss how to add one later in this section. The example code adds a 3D cone to the viewpoint.
The FOV specifies how much of the scene is visible in terms of an angular spread around the viewpoint. The default is 45 degrees ...