Camera QML Type

  • Esri.ArcGISRuntime
  • Camera
  • 3D view description modeled as a virtual camera. More...

    Import Statement: import Esri.ArcGISRuntime
    Since: Esri.ArcGISRuntime 100.0
    Inherits:

    Object

    Properties

    Signals

    Methods

    • Camera elevate(double deltaAltitude)
    • bool equals(Camera camera)
    • Camera moveForward(double distance)
    • Camera moveTo(Point location)
    • Camera moveToward(Point targetPoint, double distance)
    • Camera rotateAround(Point targetPoint, double deltaHeading, double deltaPitch, double deltaRoll)
    • Camera rotateTo(double heading, double pitch, double roll)
    • Camera zoomToward(Point targetPoint, double factor)

    Detailed Description

    A Camera contains the spatial parameters to set a 3D view on a Scene in a SceneView: a virtual camera's location, orientation and field of view. The Viewpoint contains a camera. See the API doc for Viewpoint for details of how it uses a Camera.

    You can initialize the camera in several different ways: creating from a location, heading, pitch, pitch, roll, and an optional distance, or creating from transformation matrix. Each method of initialization is mutually exclusive.

    Camera orientation

    • The ENU (East-North-Up) ground reference frame is used.
    • Heading is expressed in degrees of rotation around its Z axis, clockwise from north. Negative headings are allowed and heading can wrap around (i.e 361 wraps to a value of 1).
    • Pitch is expressed in degrees of rotation around its Y axis, from 0 looking straight down to 180 looking straight up towards the sky. Negative pitches are not allowed, and the values do not wrap around. If the behavior of a negative pitch is required, then the corresponding transformation with positive pitch can be set instead. For example if heading:0 pitch:-20 roll:0 is required, then heading:180 pitch:20 roll:180 can be used instead.
    • Roll is expressed in degrees of rotation around its X axis, from 0 to 360, with 0 being horizontal.
    • Field of view is the vertical angular extent of a given scene as imaged by the virtual camera.
    • Distances for moveForward and moveToward are expressed in meters.

    Camera transformation

    A Camera object is immutable. The Camera type includes helper methods for advanced transformations of location and orientation. The result of the transformation is a new Camera object. Each transformation is based either solely on the camera's location and orientation, or in addition incorporates a reference to another location.

    Transformations are applied in this order:

    • Set the camera location to (x=0, y=0, z=0) with heading, pitch, and roll all set to zero.
    • Set the camera to the new location.
    • Set the heading.
    • Set the pitch.
    • Set the roll.

    Default properties

    This QML type supports the following default properties. A default property may be declared inside another declared object without being assigned explicitly to a property.

    TypeDefault Property
    Pointlocation
    TransformationMatrixtransformationMatrix (since Esri.ArcGISRuntime 100.6)

    Example:

    Create a Camera to be used for setting the viewpoint on a SceneView:

    Camera {
        id: camera
        heading: 10.0
        pitch: 80.0
        roll: 0.0
    
        Point {
            x: 83.9
            y: 28.4
            z: 10010.0
            spatialReference: SpatialReference { wkid: 4326 }
        }
    }

    Property Documentation

    distance : double

    The distance of this Camera.

    This property is only populated if explicitly set. Cameras that are created and returned from the API will return NaN.


    heading : double

    The heading of this Camera.

    See also Camera orientation.


    [default] location : Point

    The location of this Camera.


    pitch : double

    The pitch of the camera (read-only).

    The pitch value must be from 0 to 180 and represents the angle applied to the camera when rotating around its Y axis in the East, North, Up (ENU) ground reference frame. 0 is looking straight down towards the center of the earth, 180 looking straight up towards the sky. Negative pitches are not allowed and the values do not wrap around. If the behavior of a negative pitch is required, then the corresponding transformation with positive pitch can be set instead. For example if heading:0 pitch:-20 roll:0 is required then heading:180 pitch:20 roll:180 can be used instead.

    See also Camera.


    roll : double

    The roll of this Camera.

    See also Camera orientation.


    [default, since Esri.ArcGISRuntime 100.6] transformationMatrix : TransformationMatrix

    The transformation matrix of this Camera.

    The transformation matrix describes the camera's location and the direction it is looking. Setting this property with the location provided by ARKit/ARCore is necessary for enabling augmented reality.

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

    This property was introduced in Esri.ArcGISRuntime 100.6.


    Signal Documentation

    [since Esri.ArcGISRuntime 100.4] distanceChanged()

    Emitted when the distance property changes.

    Note: This signal will only be emitted when the property initializes during the instantiation of the component.

    Note: The corresponding handler is onDistanceChanged.

    This signal was introduced in Esri.ArcGISRuntime 100.4.


    [since Esri.ArcGISRuntime 100.4] headingChanged()

    Emitted when the heading property changes.

    Note: This signal will only be emitted when the property initializes during the instantiation of the component.

    Note: The corresponding handler is onHeadingChanged.

    This signal was introduced in Esri.ArcGISRuntime 100.4.


    [since Esri.ArcGISRuntime 100.4] locationChanged()

    Emitted when the location property changes.

    Note: This signal will only be emitted when the property initializes during the instantiation of the component.

    Note: The corresponding handler is onLocationChanged.

    This signal was introduced in Esri.ArcGISRuntime 100.4.


    [since Esri.ArcGISRuntime 100.4] pitchChanged()

    Emitted when the pitch property changes.

    Note: This signal will only be emitted when the property initializes during the instantiation of the component.

    Note: The corresponding handler is onPitchChanged.

    This signal was introduced in Esri.ArcGISRuntime 100.4.


    [since Esri.ArcGISRuntime 100.4] rollChanged()

    Emitted when the roll property changes.

    Note: This signal will only be emitted when the property initializes during the instantiation of the component.

    Note: The corresponding handler is onRollChanged.

    This signal was introduced in Esri.ArcGISRuntime 100.4.


    [since Esri.ArcGISRuntime 100.6] transformationMatrixChanged()

    Emitted when the transformationMatrix property changes.

    Note: The corresponding handler is onTransformationMatrixChanged.

    This signal was introduced in Esri.ArcGISRuntime 100.6.


    Method Documentation

    Camera elevate(double deltaAltitude)

    Create a new Camera object with the same orientation and x,y location as this one, with altitude (z-value) changed by deltaAltitude.


    bool equals(Camera camera)

    Returns whether this Camera and another camera are equivalent.


    Camera moveForward(double distance)

    Create a Camera object with the same orientation as this one, but moved along its heading by distance meters.


    Camera moveTo(Point location)

    Create a new Camera object with the same orientation as this one, moved to a new location.


    Camera moveToward(Point targetPoint, double distance)

    Create a new Camera object with the same orientation as this one, moved toward a given targetPoint by a given distance in meters.

    Note that targetPoint indicates the direction the camera should be moved. This is not the same thing as the direction that the camera should be oriented.


    Camera rotateAround(Point targetPoint, double deltaHeading, double deltaPitch, double deltaRoll)

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

    • targetPoint - The point location around which the camera will move.
    • deltaHeading - The delta angle in degrees by which the output camera heading will be rotated around the target_point.
    • deltaPitch - The delta angle in degrees by which the output camera pitch will be rotated around the target_point.
    • deltaRoll - The delta angle in degrees by which the output camera roll will be rotated around the target_point.

    The result of this transformation is a new camera with the following characteristics:

    • The orientation of the camera is changed by the specified values of heading, pitch, and roll.
    • The target point remains in the same relative location in the view.
    • The camera location is the same distance from the target point.

    See also Camera.


    Camera rotateTo(double heading, double pitch, double roll)

    Creates a copy of the camera with a change in pitch, heading and roll to the given angles in degrees.

    • heading - The angle in degrees to which the output camera heading will be rotated.
    • pitch - The angle in degrees to which the output camera pitch will be rotated. The value must be from 0 to 180 and represents the angle applied to the camera when rotating around its Y axis in the East, North, Up (ENU) ground reference frame. 0 is looking straight down towards the center of the earth, 180 looking straight up towards the sky. Negative pitches are not allowed and the values do not wrap around. If the behavior of a negative pitch is required, then the corresponding transformation with positive pitch can be set instead. For example if heading:0 pitch:-20 roll:0 is required then heading:180 pitch:20 roll:180 can be used instead.
    • roll - The angle in degrees to which the output camera roll will be rotated.

    See also Camera.


    Camera zoomToward(Point targetPoint, double factor)

    Creates a copy of the camera with the position moved in the direction of a target point by a given zoom factor.

    • targetPoint - The point location towards which the camera will zoom.
    • factor - The factor the output camera will be moved.

    See also Camera.


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