Axis Triad and Navcube

Both the NavCube and the Axis Triad are prebuilt tools that help with scene navigation that are drawn in an overlay layer. For more info on overlays, see the Overlays Programming Guide and the overlay sample in the applicationsclientexamples directory.

../../../_images/axis_triad_nav_cube_main.png

Axis triad

../../../_images/axis_triad_nav_cube_triad.png

The axis triad is a visualization of the X, Y and Z axis orientation. The axis geometry is drawn in an overlay. Selecting an axis will rotate the scene to orient it along the selected axis. This is controlled by the Axis Triad operator.

Modifying the axis triad

The AxisTriad class provides an interface to enable / disable, set the anchor position, and change the axis colors for the axis triad. For example, the following snippet changes the axis triad X axis to yellow, and positions the axis triad in the center of the screen.

        const axisTriad = hwv.view.getAxisTriad();
        axisTriad.setAxisColor(Communicator.Axis.X, Communicator.Color.yellow());
        axisTriad.setAnchor(Communicator.OverlayAnchor.Center);
../../../_images/axis_triad_nav_cube_modifying.png

Modifying the NavCube

The NavCube class provides an interface to enable / disable, and set the anchor position of the NavCube. For example, the following snippet positions the axis triad in the center of the screen.

        const navCube = hwv.view.getNavCube();
        navCube.setAnchor(Communicator.OverlayAnchor.Center);