5.36. Navigation

<navigation> ‐ The control of the user navigation in the scene

5.36.1. Attributes

NameTypeDefaults
navigation_modeSTRING (quad, sphere)quad
navigation_stepFLOAT0.3
start_xFLOAT0.0
start_yFLOAT0.0
start_zFLOAT0.0
navigation_minimal_xFLOAT0.0
navigation_maximal_xFLOAT1000.0
navigation_minimal_yFLOAT0.0
navigation_maximal_yFLOAT1000.0
navigation_minimal_zFLOAT0.0
navigation_maximal_zFLOAT1000.0
start_yawFLOAT0.0
start_pitchFLOAT0.0
rotation_amplitude_yawFLOAT1.0
rotation_amplitude_pitchFLOAT1.0

5.36.2. Description

This element is a child element of a user elements. It defines the parameters of the navigation of this user. There are two modes of navigation: a planar mode in which displacements are made horizontally, and a spherical mode in which displacements are made on the surface of a sphere. Navigation is controlled by the mouse. The button used for navigating in a window is given by the mouse_navigation attribute of the window layout element in the configuration file. Navigation consists in pressing the associating button and using the mouse to define the motion direction. By pressing the shift key, motion is performed backwards instead of forward.

The string value of the navigation_mode attribute defines the navigation mode: the quad value corresponds to the planar mode, and the sphere value corresponds to the spherical mode.

In both modes, navigation is constrained to occur between minimal and maximal values for x, y, and z, given by the float values of the navigation_minimal_x, navigation_maximal_x, navigation_minimal_y, navigation_maximal_y, navigation_minimal_z, and navigation_maximal_z attributes. In the planar mode, the height is the y value above the xOz horizontal plane. In the spherical mode, the height is the distance to the origin (the radius of the spherical motion). These values are defined with respect to the coordinates system of the current viewpoint.

The float value of the start_x, start_y, and start_z attributes define the initial (plane or spherical) coordinates of the user in its current viewpoint. The float values start_yaw and start_pitch of the start_yaw and start_pitch attributes define the initial orientation of the user. The start_yaw value defines the initial motion direction, and the start_pitch value controls the user tilt towards the ground or towards the sky.

The float values of the navigation_step attribute defines the elementary step used for computing mouse-controlled forward and backward user motion. This step is a linear step in the case of a planar navigation, and an angular step in the case of a spherical navigation.

The float values of the rotation_amplitude_yaw and rotation_amplitude_pitch attributes define the elementary angular step used for computing the angular rotation of the camera (yaw and pitch) from mouse motion, or right/left arrow and page up/page down keys. These values must be set to 0.0 in order to avoid camera rotation through mouse motion or displacement key strokes.

5.36.3. Expected content

None.

5.36.4. Example

The example below defines a spherical motion that begins at a distance of 60.2 from the origin of the current viewpoint, and at angular coordinates of 42 and 45 degrees. The user is rotated 180 degrees, and the navigation height (the distance from the origin of the current viewpoint) is constrained to the interval [60.2..100.0]. The value of the elementary step for user motion is 0.06.

<navigation navigation_mode="sphere" 
  start_y="60.2" navigation_step="0.06" 
  navigation_minimal_y="60.2" navigation_maximal_y="100" 
  start_x="42" start_z="45" start_pitch="0" start_yaw="180"/>

The example below defines a planar motion that begins at the origin of the current viewpoint without initial rotation. The user is constrained to the interval [0..1000.0]. for the height, and to [-100.0..100.0] for the x and z coordinates. The values of the elementary motion steps are 10.0 units for user translation, and 1 degree for yaw and pitch camera rotation.

<navigation navigation_mode="quad" 
            navigation_minimal_y="0." navigation_maximal_y="1000.0" 
            navigation_minimal_x="-100." navigation_maximal_x="100.0" 
            navigation_minimal_z="-100." navigation_maximal_z="100.0" 
            navigation_step="10." rotation_amplitude_yaw="1.0" 
            rotation_amplitude_pitch="1.0" 
            start_x="0" start_y="0"  start_z="0" 
            start_pitch="0" start_yaw="0"/>