Camera

class Camera

A camera represents an observer's location and their perspective of an ArcGISScene within a SceneView. A Camera object can be thought of as a camera that you look through to see a viewable area of a scene. What you see depends on how you orientate the camera and how far it is above the Surface. A camera has four main configurable properties:

  • Location - The 3D point in space where the camera is located.

  • Heading - The angle around the z-axis the camera is rotated. The angle is clockwise from north in the East, North, Up (ENU) ground reference frame. The value is between 0 to 360. 0 is looking North and 90 is looking East.

  • Pitch - The angle around the y-axis the camera is rotated. The value is between 0 to 180. 0 is looking straight down, 180 is looking straight up.

  • Roll - The angle around the x-axis the camera is rotated. The value is between 0 to 360. 0 is horizontal, 180 is upside down.

You can construct a Camera based on these values or you can obtain it from the scene view's current viewpoint using SceneView.getCurrentViewpointCamera(). The Camera is immutable which means that once it is created it you cannot modify it.

You can define the user's camera interactions using the scene view's camera controller. The default camera controller (GlobeCameraController) allows users to freely move and focus the camera anywhere in the scene. Other camera controllers provide specialized behavior, such as:

Since

200.1.0

Constructors

Link copied to clipboard
constructor(latitude: Double, longitude: Double, altitude: Double, heading: Double, pitch: Double, roll: Double)

Creates a camera with the specified latitude, longitude, altitude, heading, pitch, and roll.

constructor(locationPoint: Point, heading: Double, pitch: Double, roll: Double)

Creates a camera with the specified location, heading, pitch, and roll.

constructor(lookAtPoint: Point, distance: Double, heading: Double, pitch: Double, roll: Double)

Creates a camera based on a point to look at, the distance to this point, heading, pitch, and roll. Note: the given values may mean that the point is not visible on screen. You can check its visibility using SceneView.locationToScreen(Point).

constructor(transformationMatrix: TransformationMatrix)

Creates a camera from a transformation matrix. The TransformationMatrix describes the camera's location and direction it is looking.

Properties

Link copied to clipboard

The heading of the camera. The angle around the z-axis the camera is rotated. The angle is clockwise from north in the East, North, Up (ENU) ground reference frame. The value is between 0 to 360. 0 is looking North and 90 is looking East.

Link copied to clipboard

The point geometry containing the location and altitude of the camera.

Link copied to clipboard

The pitch of the camera. The angle around the y-axis the camera is rotated in the East, North, Up (ENU) ground reference frame. The value is between 0 to 180. 0 is looking straight down and 180 is looking straight up.

Link copied to clipboard

The roll of the camera. The angle around the x-axis the camera is rotated in the East, North, Up (ENU) ground reference frame. The value is between 0 to 360. 0 is horizontal, 180 is upside down.

Link copied to clipboard

The camera's TransformationMatrix. It does not matter if the camera was created with a TransformationMatrix, the camera's location and orientation will always be converted into a TransformationMatrix.

Functions

Link copied to clipboard
fun elevate(deltaAltitude: Double): Camera

Creates a copy of the camera with the change in altitude applied.

Link copied to clipboard
fun moveForward(distance: Double): Camera

Creates a copy of the camera with its location moved by the specified distance in the direction the camera is facing.

Link copied to clipboard
fun moveTo(location: Point): Camera

Creates a copy of the camera with a new location.

Link copied to clipboard
fun moveToward(targetPoint: Point, distance: Double): Camera

Creates a copy of the camera with the camera moved in the direction of a target point by the specified distance.

Link copied to clipboard
fun rotateAround(targetPoint: Point, deltaHeading: Double, deltaPitch: Double, deltaRoll: Double): Camera

Creates a copy of the camera with the heading and pitch rotated from a specified target point by the delta angles in degrees.

Link copied to clipboard
fun rotateTo(heading: Double, pitch: Double, roll: Double): Camera

Creates a copy of the camera with the specified heading, pitch and roll values.

Link copied to clipboard
fun zoomToward(targetPoint: Point, factor: Double): Camera

Creates a copy of the camera with its location moved in the direction of a target point by the specified zoom factor.