You can navigate scene A scene is a collection of layers that are displayed in 3D. It is typically composed of a basemap layer, data layers, and 3D data. Learn more views (SceneView or LocalSceneView) by:

Built-in navigation

The scene views have a number of built-in gestures that allow you to navigate a scene using touch screen, mouse, or keyboard.

Basic navigation

Navigation for scene views is the same as navigation for a map view. The following table summarizes the built-in navigation capabilities of the SceneView and LocalSceneView controls:

Map navigationTouch actionMouse actionKey action
Pan the mapTouch, hold, and drag on the mapPress, hold, and drag the left mouse buttonPress the left (pan west), right (pan east), up (pan north), or down (pan south) arrows
Zoom in (+) or zoom out (-) with animationPinch open (+) or pinch close (-) on the mapScroll the mouse wheel forward (+) or backward (-)Press the + / = key for in
Press the - / _ key for out
Zoom in to the next level of detail or by a factor of 2Double tap on the mapDouble-click the left mouse buttonPress the + / = key
Zoom out to the next level of detail or by a factor of 2Single tap with two fingers simultaneouslyDouble-click of right mouse buttonPress the - / _ key
RotateTwo-finger pinch and twist fingers to rotate the map or sceneN/APress the ‘a’ (rotate counter-clockwise) or ‘d’ (rotate clockwise) keys
Set viewpoint to northN/AN/APress the ‘n’ key

Advanced navigation

Scene views have additional navigation not found in a map view:

Scene navigationTouch actionMouse actionKey action
Pitch: increase or decreaseTwo-finger touch and hold (along the horizontal axis) and then slide up and down to adjust pitchPress, hold and drag the right mouse button up (increase) or down (decrease)Press the ‘w’ (increase) or ‘s’ (decrease) keys. Press ‘p’ to set pitch to 0.
Elevation: increase or decreaseN/AN/APress the ‘u’ (increase) or ‘j’ (decrease) keys

Programmatically change camera position

Your applications can programmatically navigate a 3D scene by creating a new camera and setting it to the view you are working with. A camera defines the location from which you are viewing the scene.

Camera position for a scene view

The camera is shown in this image for illustration purposes; when you set camera settings (location, pitch), think of the camera class as a real-life camera you’re adjusting the position of.

Set the camera

For example, to point the camera to toward the Snowdon mountainside, use these values:

  • For 3D location, use 53.06 latitude, -4.04 longitude, 1289 meters above sea level
  • For heading, use 295 degrees
  • For pitch, use 71 degrees
  • For roll, use 0 degrees
const Camera sceneCamera(53.06, -4.04, 1289.0, 295.0, 71.0, 0.0);

Surface elevation applied to a scene

Apply the new camera to the scene view using SceneView::setViewpointCameraAsync(), or animate the transition to it with SceneView::setViewpointCameraAsync(&camera, duration).

m_sceneView->setViewpointCameraAsync(sceneCamera);

Move and adjust the camera

After you set a camera, you can update the scene view display by creating and applying a new camera. You can define the new camera with absolute values for location and orientation, or derive it from the current camera using relative values.

For example, using the relative approach, your code can preserve the current camera location, pitch, and roll, but rotate the heading by 45 degrees.

Use the SceneView::currentViewpointCamera() method to get the scene view’s current viewpoint camera. To adjust the viewpoint relative to the camera’s current position or orientation, use the current camera to create a new camera, then apply the new camera with SceneView::setViewpointCameraAsync().