Intermediate Tutorial


Camera Deep Dive


30 minutes

Posted on: February 1, 2018

Tags:

camera canvas,
Learn Sumerian
Camera Deep Dive

Tags

camera
canvas,

In this tutorial you will learn about:

Understanding camera types and property settings.

Cameras and how you use them in Amazon Sumerian are central to creating a compelling 3D, digital scene. In this tutorial, we walk through the various camera types and their unique property settings.

You’ll learn about:

  • Camera component
  • Camera properties
  • Script settings

Prerequisites

Before you begin, you should have completed the following tasks and tutorials:

Scene Setup

  1. From the Dashboard, create a new scene using the Default Lighting scene template. Your scene will come with lights and a Default Camera, as shown in the Entities panel.

  2. Add a Box from the Create Entity menu. A simple Box entity will provide some visual context.

Camera Types

  1. Choose Create Entity, above the canvas.

  2. In the Camera category, take a look at the various types. Each camera type has its unique capabilities:

    • Orbit (the Editor Camera, described in the next section, is a unique type of Orbit camera)
    • Fly
    • Fixed
    • 2D
  3. Add a Fly, Fixed, and 2D camera to your scene. Note that the existing Default Camera is an Orbit camera type, so we don’t need to add another.

  4. Select each camera type in the Entities panel, and then look at the Inspector panel. Notice how each camera, except for Fixed, has a Script component. Each camera’s respective script is what makes it different from another camera. In general, the differences come down to how you can control each camera in play mode or in published scenes. Expand each camera’s Script component to see the settings. We’ll cover these settings later in this tutorial.

Orbit Camera

The Default Camera found in all new scenes is an Orbit Camera, a 3D-perspective camera that can move anywhere within a scene.

The Orbit camera operates by orbiting around a central Camera Orbit Point, which is always at the center of your canvas. If you add a new camera to your scene, it will be at the center of your scene, or the Translation of (0, 0, 0). If you select another entity and choose the Frame Selection button above the canvas, or simply click the F key, that entity’s Translation values become the center Camera Orbit Point, and the canvas will frame to the center of your screen.

However, the Camera Orbit Point is contextually based as it always at the center of the canvas. Panning the camera up/down, left/right will change the Camera Orbit Point as the selected entity moves from the center of your screen. Additionally, the selected entity will no longer be the Camera Orbit Point if you change the entity’s Translation values.

Camera Controls

It’s important to know that the Editor Camera, which is the camera used in the Sumerian editing mode, functions slightly differently from cameras used in play mode. The editor camera is an Orbit camera, but with unique controls that enable you to click and select entities within the canvas. Lastly, unlike cameras in play mode, you cannot customize the Editor Camera controls.

To control the Editor Camera with a mouse (Windows and Mac):

  • Hold right-click to orbit
  • Hold left-click + hold Shift to pan
  • Hold middle-click to pan
  • Scroll wheel to zoom in/out

To control the Editor Camera with a trackpad (Mac):

  • Hold click + hold Control to orbit
  • Hold click + hold Shift to pan.
  • Two-finger vertical swipe to zoom in/out

To control the Editor Camera with a trackpad (Windows):

  • Hold right-click + to orbit
  • Hold left-click + hold Alt to orbit
  • Hold left-Click + hold Shift to pan.
  • Vertical or horizontal swipe two fingers to zoom in/out

Keyboard controls and hotkeys:

  • F:Pressing the F key will automatically frame the selected entity in the center of your canvas.
  • Z:Pressing the Z key will give return your editor camera to it’s last position. Note: This hotkey only works when using other camera hotkeys.
  • X: Pressing the X key will place the editor camera near the Y and Z Translation values of 0, creating a side view parallel with the X axis. Pressing the X key a second time provide the inverse view.
  • C: Pressing the C key will place the editor camera near the Y and X Translation values of 0, creating a side view parallel with the Z axis. Pressing the C key a second time provide the inverse view.
  • X: Pressing the V key will place the editor camera near the X and Z Translation values of 0, creating a top view parallel with the Y axis.. Pressing the X key a second time provide the inverse view.

Note: Remember, the default controls for an Orbit Camera in play mode are nearly identical to the controls of the Editor Camera, the primary difference being you cannot select entities in play mode without a custom script.

  1. Choose the Box in the Entities panel and click the F key on your keyboard.

  2. With your scroll wheel, zoom out from the Box.

  3. In the canvas, hold right-click and orbit the camera. Your camera will orbit around the Box’s Translation of (0, 0, 0).

  4. Drag the Box to different X or Z Translation values.

  5. Choose the Frame Selection button (above the canvas) or click the F key. Your camera is now zoomed in directly on the Box.

  6. In the canvas, zoom out, and then hold right-click and orbit the camera. Your camera will orbit around the Box’s new Translation values.

  7. Zoom in as far as you can. Notice you can’t zoom through the Box.

Now that you understand how to operate an Orbit camera, we will look at the property settings within the Camera component.

Camera Component

With the Orbit camera, or in our case the Default Camera, still selected, navigate to the Camera component.

  • Main Camera: Defines the primary camera when in play mode.
  • Follow Editor Camera: Updates the camera’s Transform as you move the Editor Camera. This property sets the camera in play mode in the same position as in edit mode. Therefore, when you press play, your camera stays in the same location.
  • Clipping Planes: Defines how near or far a camera can see.

    By default the Near and Far settings are set to 1 and 1000 (meters), respectively. Typically, these values work for most scenes. However, let’s experiment with them to see how they function.

    1. Press play.
    2. Set the Near value to 100. Notice how the grid in the foreground disappears. This is because the camera can’t see anything before 100 units. Scroll in or out to see the Box going in or out of view.