Observer3D moves the view over terrain in Java 3D 1.5.2 based on mouse movements. It is designed for use with open ground (as opposed to deep space, air, underwater, caverns, and other indoor spaces). It was written originally for a fast-paced game, and so had to be highly responsive and intuitive to enable the user to focus on and control the action. (In other words, it had to let the player focus on the action rather than on the view controls.) It replaced com.sun.j3d.utils.behaviors.vp.OrbitBehavior when the user was working with a landscape and its contents. It extends javax.media.j3d.Behavior.
The viewing angle is limited to a 90 degree vertical rotation, from horizontal to straight down. The view's vertical position is always positive (above ground). A left button drag moves the view left and right and forward and back. A right button drag moves the view up, down, left, and right on a hemisphere around the point on the ground being observed. A left button drag with the control key pressed swivels the view up, down, left, and right without moving the viewer. The mouse wheel zooms in and out. With the control key down, it takes the view straight up and down without changing the view angles.
The result is highly intuitive motion and a stable view.
A listener class is provided with mouse actions to allow the code using Observer3D to react to clicks and mouse movement. A method is provided to identify objects in the scene that have been clicked on or that the mouse is hovering over. There is also a method to locate the ground that is visible in the 3D view.
A sample program is included with the source code that demonstrates mouse clicks, labels on objects the mouse is hovering over, and pop-up menus. It has a 2D map with the area visible in the 3D view outlined in orange. It also demonstrates the ease of maneuvering over the terrain. (This example would be a quick way for a beginner to get started with 3D programming, but be sure to get hold of Java 3D 1.5.2 first.)
Observer3D requires Java 3D, version 1.5.2. It is thread safe. It is fully Javadoc'ed.