Skip to content

You can navigate scene 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:

NavigationMouseTouchKey Action (on iOS and Mac Catalyst)
Zoom in• Scroll backward
• Hold shift + drag up
• Double tap
• Two finger pinch open
      Drag gesture
• Single finger double-tap
      Drag gesture
• =
Zoom out• Scroll forward
• Hold shift + drag down
• Two finger pinch close
      Drag gesture
• Two finger single-tap
• -
Continuous zoom in/out• N/A• Single finger double-tap, ending in a vertical up/down drag
      Drag gesture       Drag gesture
• N/A
Move/Pan• Tap and drag• Single finger drag
      Drag gesture
• Flick
      Flick gesture
• ↑
• ↓
• ←
• →
Rotate the scene• Hold down ⌥ and drag left/right• Two finger rotate
      Twist gesture
• ⌥← for left
• ⌥→ for right
Rotate to North• N/A• N/A• ⌘0
• shift ⌘↑
Camera look-around effect• N/A• Single finger double-tap and hold. The camera's heading changes when you drag left/right and the pitch changes at the current location when you drag up/down• N/A
Tilt up/down• Hold down ⌥ and drag up/down• N/A• ⌥↑ to tilt up
• ⌥↓ to tilt down
Tilt to zero• N/A• N/A• shift 0

Advanced navigation

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

NavigationUser ActionKey Action (on iOS and Mac Catalyst)
Tilt the scene• Two-finger drag
      Two finger drag left/right gesture
• ⌥↑ for tilt up
• ⌥↓ for tilt down
• ⇧0 for tilt to 0

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
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
    static let snowdonCamera = Camera(
        latitude: 53.06,
        longitude: -4.04,
        altitude: 1289,
        heading: 295,
        pitch: 71,
        roll: 0
    )
Surface elevation applied to a scene

You now have a new camera to apply to the scene view. You can apply it immediately using setViewpointCamera, as shown in the code below for a SceneView, or the camera can be animated to the new position using one of the asynchronous methods.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
        SceneViewReader { sceneViewProxy in
            SceneView(scene: scene)
                .task {
                    await sceneViewProxy.setViewpointCamera(ScenesNavigateView.snowdonCamera)
                }
        }

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.