Using Navigation
The 3D Viewer API provides a set of methods for navigating within the 3D scene. Here we will explain how to get started with some common ways of using navigation with the 3D Viewer.
Use navigation modes to handle mouse and touch input devices. The setNavigationMode method allows you to define different navigation modes for each input device and user interaction.
To begin, set the enableTouch option to true when creating the 3D Viewer instance. This will enable touch screen devices to interact with the 3D scene.
Next, when setting up navigation with touch screen devices we recommend using the orbit navigation mode. This mode allows the user to orbit the camera around a point by dragging with one finger. The pan navigation mode is also available for panning the camera by dragging with one finger.
Then depending on whether you choose pan or orbit you can also map the pinch gesture to move forwards and backwards or zoom in and out. Additionally, you can also map the long press gesture to add another dimension of interaction.
Learn more about the setNavigationMode method here.
Use direct navigation when setting up navigation for other input devices with the updateNavigation method. By mapping user inputs to different movements you can control the camera in the 3D scene.
Learn more about the updateNavigation method here.