3D scenes are always rendered from a viewpoint (sometimes called a camera). In Vizard you can create as many viewpoints as you wish, although the main viewpoint is provided automatically and is used to render the standard 3D window. By default this viewpoint navigates via the mouse. You have a number of different options, though, when it comes to moving, rotating, and linking viewpoints (see below). The main library of commands for viewpoints is the <viewpoint> library.
Note: to turn off mouse navigation, use viz.mouse(<on or off>).
To grab the main view, use viz.MainView. To create new viewpoints, use viz.addView. Use commands from the <viewpoint> class to manipulate your views.
By default, the main view navigates via the mouse. If you're using a position or orientation tracking device to navigate through your world, you'll want to link your view to that sensor using viz.link( <sensor>, <view> ). Of course you can link any your main view or any other view to any object as well using link. For more options here, check out the section on linking. For more options on mouse navigation, check out the section on creating your own camera handlers.
Every viewpoint has a body and a head. The head and body are reference frames controlled in a hierarchical fashion. You can think of the head as a child of the body-- any motions applied to the body are passed onto the head, but motions applied to the head don't affect the body. This distinction is important in many of the commands you use to move or get information about the viewpoint. In these commands, you can use the flags viz.BODY_ORI to indicate the body orientation or viz.HEAD_ORI to indicate the head orientation. When you're getting information about the head orientation, you can get a composite of the head and body orientations using the viz.VIEW_ORI flag.
Vizard automatically sets the eyeheight at 1.82 meters (6 feet). To change this default within your script use <view>.eyeheight( <height> ). When you reset a view with <view>.reset, the view, it will reset to this height.
To reset the viewpoint's position or orientation use <viewpoint>.reset(<what>) where <what> can either be the head's position (viz.HEAD_POS), the head's orientation (viz.HEAD_ORI) or the body's orientation (viz.BODY_ORI). Note: resetting the head's position will place it at eyeheight above the origin.
You can also reset the viewpoint by using Vizard's camera handler. Here the command is viz.cam.reset(). The advantage to using the camera reset is that you can change the location and orientation that the viewpoint will reset to by placing the viewpoint where you want it and then calling viz.cam.setReset(). From that point on, when you call viz.cam.reset(), the view will reset to that position and orientation.
For more on controlling and animating viewpoints, check out the sections on view animation and the camera handler. For information on how to handle view collisions and view-triggered events, check out the section on view collision.
Moving and rotating a viewpoint
Viewpoint collision and gravity