Class: Camera

Camera

new Camera(scene)

Camera class, defined by position, orientation, and viewing cone. The viewing frustum is defined by six planes (up, down, left, right, near, far), each of which can be represented by a Cartesian object. The x, y, and z components define the unit vector perpendicular to the plane, and the w component is the distance from the plane to the origin/camera position.

Name Type Description
scene Scene

Scene objects.

Example
// Create a camera object.
var camera = new SuperMap3D.Camera(scene);
camera.position = new SuperMap3D.Cartesian3();
camera.direction = SuperMap3D.Cartesian3.negate(SuperMap3D.Cartesian3.UNIT_Z, new SuperMap3D.Cartesian3());
camera.up = SuperMap3D.Cartesian3.clone(SuperMap3D.Cartesian3.UNIT_Y);
camera.frustum.fov = SuperMap3D.Math.PI_OVER_THREE;
camera.frustum.near = 1.0;
camera.frustum.far = 2.0;

Members

static DEFAULT_OFFSETHeadingPitchRange

The default orientation/pitch/distance used when the camera flies to a position containing the surrounding ball.

static DEFAULT_VIEW_FACTORNumber

A scalar used to multiply the position of the camera and add it back after setting the camera viewing rectangle. A value of 0 indicates that the camera will view the entire Camera # DEFAULT_VIEW-RECTANGLE rectangle, a value greater than 0 indicates that the camera will move away from the rectangle range, and a value less than 0 indicates that the camera will move closer to the rectangle range.

static DEFAULT_VIEW_RECTANGLERectangle

The default rectangle that the camera will view when created.

readonly changedEvent

Get the events that will be triggered when the camera is changed by percentagechange.

constrainedAxisCartesian3

If set, the camera will not be able to rotate around this axis in any direction.

Default Value:
undefined

defaultLookAmountNumber

When the viewing method provides parameters, the camera angle is rotated by default.

Default Value:
Math.PI / 60.0

defaultMoveAmountNumber

When the moving method does not provide parameters, the default value for moving the camera.

Default Value:
100000.0;

defaultRotateAmountNumber

When no parameters are provided for the rotate method, the camera distance is moved by default.

Default Value:
Math.PI / 3600.0

defaultZoomAmountNumber

When providing parameters in the scaling method, rotate the camera to its default value.

Default Value:
100000.0;

directionCartesian3

Camera view direction.

readonly directionWCCartesian3

Obtain the camera's viewing direction in geographic coordinates.

flyCircleLoopBoolean

Set whether the camera rotates around a point to enable loop mode.

Example
var scene = viewer.scene;
var camera = scene.camera;
// Set camera loop mode
camera.flyCircleLoop = true;

flyClampToGroundBoolean

Set whether to fly close to the ground, default to flag. When set to true, it will always fly above the terrain and will not enter the interior of the terrain.

frustumFrustum

The spatial area in the field of view, namely the cone of view.

Default Value:
PerspectiveFrustum()
See:

readonly headingNumber

Obtain the camera azimuth in radians.

readonly inverseTransformMatrix4

Obtain the inverse transformation of the camera.

Default Value:
Matrix4.IDENTITY

readonly inverseViewMatrixMatrix4

Obtain the inverse view matrix.

See:

maximumZoomFactorNumber

Multiply the coefficient of the map size to determine the gripping position of the camera when zooming in from the surface. Only valid for 2D maps, and the map is rotatable.

Default Value:
1.5

readonly moveEndEvent

Get the event that will be triggered when the camera stops moving.

readonly moveStartEvent

Get the event that will be triggered when the camera starts moving.

percentageChangednumber

The number of changes that the camera must make before triggering a changed event. The value is a percentage within the range of [0,1].

Default Value:
0.5

readonly pitchNumber

Obtain the camera's pitch angle in radians.

positionCartesian3

The position of the camera object.

readonly positionCartographicCartographic

Obtain the Cartographic position of the camera, with longitude and latitude in radians and altitude in meters. In 2D and Columbus views, when the camera is located outside the map, the returned longitude and latitude may exceed the valid range of longitude and latitude.

readonly positionWCCartesian3

Obtain the position of the camera in geographic coordinates.

The correct orientation of the camera.

readonly rightWCCartesian3

Obtain the correct orientation of the camera based on geographic coordinates.

readonly rollNumber

Obtain the camera rotation angle in radians.

sensitivePositionRatioNumber

Get or set the scale of terrain sensitive points within the range of 0-1.

speedRatioNumber

Set the rotation rate around the point.

readonly transformMatrix4

Obtain the reference frame of the camera. The inverse value of this transformation will be added to the view matrix.

Default Value:
Matrix4.IDENTITY

The upward direction of the camera.

readonly upWCCartesian3

Obtain the upward direction of the camera based on geographic coordinates.

readonly viewMatrixMatrix4

Obtain the view matrix.

See:

Methods

cameraToWorldCoordinates(cartesian, result){Cartesian4}

Convert vectors or points from the camera's reference frame to geographic coordinates.

Name Type Description
cartesian Cartesian4

The vector or point to be transformed.

result Cartesian4 optional

The object that stores the results.

Returns:
Type Description
Cartesian4 The transformed vector or point.

cameraToWorldCoordinatesPoint(cartesian, result){Cartesian3}

Convert a point from the camera's reference frame to geographic coordinates.

Name Type Description
cartesian Cartesian3

The point to be transformed.

result Cartesian3 optional

The object that stores the results.

Returns:
Type Description
Cartesian3 Conversion point.

cameraToWorldCoordinatesVector(cartesian, result){Cartesian3}

Convert vectors from the camera's reference frame to geographic coordinates.

Name Type Description
cartesian Cartesian3

The vector to be converted.

result Cartesian3 optional

The object that stores the results.

Returns:
Type Description
Cartesian3 The transformed vector.

cancelFlight()

Cancel the currently ongoing camera flight. The camera will remain in its current position.

computeViewRectangle(ellipsoid, result){Rectangle|undefined}

Calculate the approximate value of visible rectangles on ellipsoids.

Name Type Default Description
ellipsoid Ellipsoid Ellipsoid.WGS84 optional

An ellipsoid in the visible region.

result Rectangle optional

A rectangle for storing results.

Returns:
Type Description
Rectangle | undefined Visible rectangle, undefined if ellipsoid is not visible at all.

disableReflection()

Disable reflection modifications that were previously enabled using enableReflection.

distanceToBoundingSphere(boundingSphere){Number}

Return the distance from the camera to the front of the surrounding sphere.

Name Type Description
boundingSphere BoundingSphere

The enclosing sphere in geographic coordinates.

Returns:
Type Description
Number The distance to the surrounding ball.

enableReflection(plane)

Modify this frustum to always render through the self reflection of the specified plane.

Name Type Description
plane Plane optional

Flat reflection.

flyCircle(center)

The camera rotates around the center point.

Name Type Description
center Number

The three-dimensional spatial coordinate values of the points drawn in the scene.

Example
var scene = viewer.scene;
var camera = scene.camera;
var handlerPoint = new SuperMap3D.DrawHandler(viewer,SuperMap3D.DrawMode.Point);
    handlerPoint.drawEvt.addEventListener(function(result){
    center = result.object.position;
// The camera rotates around the center point.
    camera.flyCircle(center);
    });

flyHome(duration)

Set the camera to the main view. Set the default view of the 3D scene using {@ Link Camera #. DEFAULT_VIEW-RESTANGLE}. The main view displays the entire map in both 2D and Columbus views.

Name Type Description
duration Number optional

Flight time is measured in seconds. If omitted, SuperMap3D will attempt to calculate the ideal duration based on the distance flown. Refer to Camera # flyTo

flyTo()

The camera flies from its current position to a new spatial location.

Name Type Description
options.destination Cartesian3 | Rectangle

The final position of the camera in the WGS84 geographic coordinate system, or the rectangular area visible in the top-down view.

options.orientation Object optional

An object that contains attributes such as direction, up, heading, pitch, and roll. By default, the 3D orientation points towards the center of the frame and in the Columbus view, it points towards the negative z-direction. In 3D, the up direction points towards the local north direction, while in Columbus view, it points towards the positive y direction. In infinite scrolling mode, the 2D view does not use orientation.

options.duration Number optional

Flight duration (in seconds). If omitted, calculate a reasonable duration based on the flight distance.

options.complete Camera~FlightCompleteCallback optional

The function executed upon completion of the flight.

options.cancel Camera~FlightCancelledCallback optional

The function executed when the flight is cancelled.

options.endTransform Matrix4 optional

The transformation matrix of the reference frame in which the camera will be located upon completion of the flight.

options.maximumHeight Number optional

The maximum altitude during flight.

options.easingFunction EasingFunction | EasingFunction~Callback optional

Call the function upon release.

options.pitchAdjustHeight Number optional

If the camera flies above this value, adjust the pitch angle to look down and keep the Earth in the viewport.

options.flyOverLongitude Number optional

There are always two paths between two points on Earth. This option will force the camera to choose a direction to fly over that longitude.

options.flyOverLongitudeWeight Number optional

Only when the longitude flown does not exceed the short distance time weighted by the longitude flown, will it fly over the longitude specified by the longitude flown.

Throws:

If either direction or up direction is provided, then both need to be provided.

Type
DeveloperError
Example
// 1. Fly to the position represented by a top-down view
viewer.camera.flyTo({
    destination : SuperMap3D.Cartesian3.fromDegrees(-117.16, 32.71, 15000.0)
});

// 2. Fly to the rectangle represented by a top-down view
viewer.camera.flyTo({
    destination : SuperMap3D.Rectangle.fromDegrees(west, south, east, north)
});

// 3. Fly to the position where the orientation is represented by a unit vector
viewer.camera.flyTo({
    destination : SuperMap3D.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0),
    orientation : {
        direction : new SuperMap3D.Cartesian3(-0.04231243104240401, -0.20123236049443421, -0.97862924300734),
        up : new SuperMap3D.Cartesian3(-0.47934589305293746, -0.8553216253114552, 0.1966022179118339)
    }
});

// 4. Fly to the position where the orientation is represented by heading, pitch, and roll angles
viewer.camera.flyTo({
    destination : SuperMap3D.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0),
    orientation : {
        heading : SuperMap3D.Math.toRadians(175.0),
        pitch : SuperMap3D.Math.toRadians(-35.0),
        roll : 0.0
    }
});

flyToBoundingSphere(boundingSphere, options)

Move the camera to the position in the current view that contains the provided bounding ball.

The offset is the azimuth/elevation/range in the local northeast upper reference frame centered around the center of the enclosing sphere. The azimuth and elevation angles are defined in the local East North reference frame. The orientation is the angle from the y-axis to the x-axis. The pitch is the rotation of the x-plane. The positive elevation angle is below the plane. The negative elevation angle is above the plane. Distance is the distance to the center. If the range is 0, calculate a range that makes the entire enclosing sphere visible.

In both 2D and Columbus views, there must be a top-down view. The camera will be placed above the target and viewed downwards. The height above the target is the distance. The title will be directed towards the north of the local area.

Name Type Description
boundingSphere BoundingSphere

The bounding ball to be viewed is represented in geographic coordinates.

options Object optional

Properties of the following objects:

Name Type Description
duration Number optional

Flight duration (in seconds). If omitted, SuperMap3D will calculate the ideal duration based on the flight distance.

offset HeadingPitchRange optional

The offset from the target in the local northeast upper reference frame centered on the target.

complete Camera~FlightCompleteCallback optional

The function executed after the flight is completed.

cancel Camera~FlightCancelledCallback optional

The function to be executed when the flight is cancelled.

endTransform Matrix4 optional

Transform matrix, representing the reference frame where the camera is located at the end of the flight.

maximumHeight Number optional

The maximum altitude during peak flight.

pitchAdjustHeight Number optional

If the camera flies above this value, adjust the pitch angle to look down and keep the Earth in the viewport.

flyOverLongitude Number optional

There are always two paths between two points on Earth. This option will force the camera to choose a direction to fly over that longitude.

flyOverLongitudeWeight Number optional

Only when the longitude flown does not exceed the short distance time weighted by the longitude flown, will it fly over the longitude specified by the longitude flown.

easingFunction EasingFunction | EasingFunction~Callback optional

Control how time is interpolated during flight.

getMagnitude(){Number}

Obtain the size of the camera position. In three dimensions, this is the magnitude of the vector. In 2D and Columbus views, this is the distance to the map.

Returns:
Type Description
Number The size of the location.

getPickRay(windowPosition, result){Ray}

Create a ray that passes through the pixel of the window position from the camera position, using geographic coordinates as the unit.

Name Type Description
windowPosition Cartesian2

The x and y coordinates of the pixel.

result Ray optional

The object that stores the results.

Returns:
Type Description
Ray Return the Cartesian 3 position and direction of the ray.

getPixelSize(boundingSphere, drawingBufferWidth, drawingBufferHeight){Number}

Returns the pixel size in meters.

Name Type Description
boundingSphere BoundingSphere

The enclosing sphere in geographic coordinates.

drawingBufferWidth Number

Draw buffer width.

drawingBufferHeight Number

Draw buffer height.

Returns:
Type Description
Number The pixel size measured in meters.

getRectangleCameraCoordinates(rectangle, result){Cartesian3}

Obtain the camera position required to view rectangles on ellipsoids or maps

Name Type Description
rectangle Rectangle

The rectangle to be viewed.

result Cartesian3 optional

View the camera position required for the rectangle.

Returns:
Type Description
Cartesian3 View the camera position required for the rectangle.

look(axis, angle)

Rotate the direction vector angle of each camera around the axis

Name Type Description
axis Cartesian3

The axis to be rotated.

angle Number optional

The angle of rotation, measured in radians. The default value is defaultLookMount.

See:

lookAt(target, offset)

Set the camera position and direction through target and offset. The target is represented in geographic coordinates; Offset refers to the Cartesian coordinates or "heading/pitch/range" in the local "East North Up" reference frame centered on the target. If offset is represented by Cartesian coordinates, it represents the offset from the center of the reference frame defined by the transformation matrix. If offset is represented by "heading/pitch/range", the angles of heading and pitch are determined by the reference frame defined by the transformation matrix. Heading increases from the y-axis towards the x-axis, and pitch is the rotation angle from the xy plane. Positive pitch is located below the plane, while negative pitch is located above the plane. Range is the distance from the center point. In 2D, it must be a top-down view, with the camera positioned above the overhead target, and the height value above the target is the magnitude of the offset. The azimuth is determined based on the offset. If the azimuth cannot be determined from the offset, the azimuth is in the north direction.

Name Type Description
target Cartesian3

The spatial location of the target in geographic coordinates.

offset Cartesian3 | HeadingPitchRange

Offset from the local "East North Up" reference frame centered on the target.

Throws:

The lookAt method is not supported during deformation.

Type
DeveloperError
Example
// 1. Set offset using Cartesian coordinates
var center = SuperMap3D.Cartesian3.fromDegrees(-98.0, 40.0);
viewer.camera.lookAt(center, new SuperMap3D.Cartesian3(0.0, -4790000.0, 3930000.0));

// 2. Set offset using HeadingPitchRange
var center = SuperMap3D.Cartesian3.fromDegrees(-72.0, 40.0);
var heading = SuperMap3D.Math.toRadians(50.0);
var pitch = SuperMap3D.Math.toRadians(-20.0);
var range = 5000.0;
viewer.camera.lookAt(center, new SuperMap3D.HeadingPitchRange(heading, pitch, range));

lookAtTransform(transform, offset)

Set the position and orientation of the camera using the target and transformation matrix. The offset can be Cartesian offset or azimuth/spacing/range offset. If the offset is Cartesian offset, it is offset from the center of the reference frame defined by the transformation matrix. If the offset is azimuth/pitch/roll, then the azimuth and pitch angles are defined in the reference frame defined by the transformation matrix. Orientation refers to the angle that increases from the Y-axis to the X-axis. The pitch angle is the rotation starting from the xy plane. The positive elevation angle is below the plane. The negative pitch angle is above the plane. The range is the distance from the center.

In two dimensions, there must be a top-down view. The camera will be placed above the center of the reference frame. The height above the target will be the magnitude of the offset. The title will be determined based on the offset. If the direction cannot be determined from the offset, the direction will be north.

Name Type Description
transform Matrix4

Define the transformation matrix of the reference frame.

offset Cartesian3 | HeadingPitchRange optional

The offset from the target in a reference frame centered around the target.

Throws:

LookAtTransform is not supported during deformation.

Type
DeveloperError
Example
// 1. Using a cartesian offset
var transform = SuperMap3D.Transforms.eastNorthUpToFixedFrame(SuperMap3D.Cartesian3.fromDegrees(-98.0, 40.0));
viewer.camera.lookAtTransform(transform, new SuperMap3D.Cartesian3(0.0, -4790000.0, 3930000.0));

// 2. Using a HeadingPitchRange offset
var transform = SuperMap3D.Transforms.eastNorthUpToFixedFrame(SuperMap3D.Cartesian3.fromDegrees(-72.0, 40.0));
var heading = SuperMap3D.Math.toRadians(50.0);
var pitch = SuperMap3D.Math.toRadians(-20.0);
var range = 5000.0;
viewer.camera.lookAtTransform(transform, new SuperMap3D.HeadingPitchRange(heading, pitch, range));

lookDown(amount)

Rotate the camera in radians around its right vector in the opposite direction to its upper vector.

Name Type Description
amount Number optional

Rotation in radians. The default value is defaultLookMount.

See:

lookLeft(amount)

Rotate the camera around the upper vector in radians, in the opposite direction to the right vector.

Name Type Description
amount Number optional

Rotation in radians. The default value is defaultLookMount.

See:

lookRight(amount)

Rotate the camera in radians along the direction of the right vector and around the vector above it.

Name Type Description
amount Number optional

Rotation in radians. The default value is defaultLookMount.

See:

lookUp(amount)

Rotate the camera around its right vector in radians along the direction of the upward vector.

Name Type Description
amount Number optional

Rotation in radians. The default value is defaultLookMount.

See:

move(direction, amount)

Translate the camera's position along the direction by a certain amount.

Name Type Description
direction Cartesian3

The direction of progress.

amount Number optional

The amount of movement, measured in meters. Default is defaultMoveAmount

See:

moveBackward(amount)

Translate the camera's position in the opposite direction to the camera view vector through an amount.

Name Type Description
amount Number optional

The amount of movement, measured in meters. The default is defaultMoveAmount.

See:

moveDown(amount)

Translate the camera's position in the opposite direction to the upward vector of the camera through an amount.

Name Type Description
amount Number optional

The amount of movement, measured in meters. The default is defaultMoveAmount.

See:

moveForward(amount)

Transform the camera's position along its view vector using an amount.

Name Type Description
amount Number optional

The amount of movement, measured in meters. The default is defaultMoveAmount.

See:

moveLeft(amount)

Translate the camera's position in the opposite direction to the right vector of the camera through an amount.

Name Type Description
amount Number optional

The amount of movement, measured in meters. The default is defaultMoveAmount.

See:

moveRight(amount)

Translate the camera's position along its right vector using an amount.

Name Type Description
amount Number optional

The amount of movement, measured in meters. The default is defaultMoveAmount.

See:

moveUp(amount)

Translate the camera's position along its upward vector using an amount.

Name Type Description
amount Number optional

The amount of movement, measured in meters. The default is defaultMoveAmount.

See:

pickEllipsoid(windowPosition, ellipsoid, result){Cartesian3}

Choose an ellipsoid or map.

Name Type Default Description
windowPosition Cartesian2

The x and y coordinates of the pixel.

ellipsoid Ellipsoid Ellipsoid.WGS84 optional

The ellipsoid to be selected.

result Cartesian3 optional

The object that stores the results.

Returns:
Type Description
Cartesian3 If ellipsoid or map is selected, return the geographic coordinates of points on the ellipsoid or map surface. If no ellipsoid or map is selected, return undefined.

rotate(axis, angle)

Rotate the camera around the axis at an angle. The distance from the camera position to the center of the camera reference frame remains unchanged.

Name Type Description
axis Cartesian3

The axis of rotation within the given geographic coordinates.

angle Number optional

The angle of rotation, measured in radians. The default value is defaultRotateAmount.

See:

rotateDown(angle)

Rotate the camera downwards by one angle around the center of the camera's reference frame.

Name Type Description
angle Number optional

The angle of rotation, measured in radians. The default value is defaultRotateAmount.

See:

rotateLeft(angle)

Rotate the camera one angle to the left around the center of the camera reference frame.

Name Type Description
angle Number optional

The angle of rotation, measured in radians. The default value is defaultRotateAmount.

See:

rotateRight(angle)

Rotate the camera to the right by one angle around the center of the camera reference frame.

Name Type Description
angle Number optional

The angle of rotation, measured in radians. The default value is defaultRotateAmount.

See:

rotateUp(angle)

Rotate the camera upwards by an angle around the center of the camera's reference frame.

Name Type Description
angle Number optional

The angle of rotation, measured in radians. The default value is defaultRotateAmount.

See:

setView()

Set camera position, orientation, and transformation.

Name Type Description
options.destination Cartesian3 | Rectangle optional

The final position of the camera in the WGS84 geographic coordinate system, or the rectangular area visible in the top-down view.

options.orientation Object optional

An object that contains attributes such as direction, up, heading, pitch, and roll. By default, the 3D orientation points towards the center of the frame and in the Columbus view, it points towards the negative z-direction. In 3D, the up direction points towards the local north direction, while in Columbus view, it points towards the positive y direction. In infinite scrolling mode, the 2D view does not use orientation.

options.endTransform Matrix4 optional

The transformation matrix representing the camera reference coordinate system.

options.convert Boolean optional

Whether to convert the camera's final position from geographic coordinates to scene coordinates, with a default value of True.

Example
// 1. Set the position via a top-down view.
viewer.camera.setView({
    destination : SuperMap3D.Cartesian3.fromDegrees(-117.16, 32.71, 15000.0)
});

// 2. Set the view via heading, pitch, and roll angles.
viewer.camera.setView({
    destination : cartesianPosition,
    orientation: {
        heading : SuperMap3D.Math.toRadians(90.0), // east, default value is 0.0 (north)
        pitch : SuperMap3D.Math.toRadians(-90),    // default value (looking down)
        roll : 0.0                             // default value
    }
});

// 3. Keep the camera's spatial position unchanged, change heading, pitch, and roll angles.
viewer.camera.setView({
    orientation: {
        heading : SuperMap3D.Math.toRadians(90.0), // east, default value is 0.0 (north)
        pitch : SuperMap3D.Math.toRadians(-90),    // default value (looking down)
        roll : 0.0                             // default value
    }
});


// 4. View the rectangle through a top-down view.
viewer.camera.setView({
    destination : SuperMap3D.Rectangle.fromDegrees(west, south, east, north)
});

// 5. Set the camera position using the orientation expressed as a unit vector.
viewer.camera.setView({
    destination : SuperMap3D.Cartesian3.fromDegrees(-122.19, 46.25, 5000.0),
    orientation : {
        direction : new SuperMap3D.Cartesian3(-0.04231243104240401, -0.20123236049443421, -0.97862924300734),
        up : new SuperMap3D.Cartesian3(-0.47934589305293746, -0.8553216253114552, 0.1966022179118339)
    }
});

stopFlyCircle()

Stop the camera from rotating around the center point.

switchToOrthographicFrustum()

Switch zoom/projection to orthographic projection.

This function is invalid in two dimensions because two dimensions are always orthogonal.

switchToPerspectiveFrustum()

Switch zoom/projection to perspective.

This function does not work in a two-dimensional space that must always maintain orthogonality.

twistLeft(amount)

Rotate the direction vector of the camera counterclockwise in radians.

Name Type Description
amount Number optional

Rotation in radians. The default value is defaultLookMount.

See:

twistRight(amount)

Rotate the direction vector of the camera clockwise in radians.

Name Type Description
amount Number optional

Rotation in radians. The default value is defaultLookMount.

See:

viewBoundingSphere(boundingSphere, offset)

Set the camera to include the provided bounding ball in the current view.

The offset is the azimuth/elevation/range in the local east-west reference frame located at the center of the enclosing sphere. The azimuth and elevation angles are defined in the local east-west reference frame. The azimuth angle is the angle from the y-axis to the x-axis, and the pitch angle is the rotation around the xy plane. The positive pitch angle is located below the plane. The negative pitch angle is located above the plane. The range is the distance from the center point. If the range is 0, a range will be calculated to make the entire enclosing sphere visible.

In two-dimensional mode, a top-down perspective must be used. The camera will be placed above the target, looking down. The height above the target will be the range. Determine the orientation based on the offset. If the direction cannot be determined based on the offset, then the direction is north.

Name Type Description
boundingSphere BoundingSphere

The bounding ball to be viewed is measured in geographic coordinates.

offset HeadingPitchRange optional

The offset from the target in the local northeast upper reference frame centered on the target.

Throws:

View bounding balls are not supported during deformation.

Type
DeveloperError

worldToCameraCoordinates(cartesian, result){Cartesian4}

Convert vectors or points from geographic coordinates to the camera's reference frame.

Name Type Description
cartesian Cartesian4

The vector or point to be transformed.

result Cartesian4 optional

The object that stores the results.

Returns:
Type Description
Cartesian4 The transformed vector or point.

worldToCameraCoordinatesPoint(cartesian, result){Cartesian3}

Convert a point from geographic coordinates to the camera's reference frame.

Name Type Description
cartesian Cartesian3

The point to be transformed.

result Cartesian3 optional

The object that stores the results.

Returns:
Type Description
Cartesian3 Conversion point.

worldToCameraCoordinatesVector(cartesian, result){Cartesian3}

Convert a vector from geographic coordinates to the camera's reference frame.

Name Type Description
cartesian Cartesian3

The vector to be converted.

result Cartesian3 optional

The object that stores the results.

Returns:
Type Description
Cartesian3 The transformed vector.

zoomIn(amount)

Scale the amount along the camera's view vector.

Name Type Description
amount Number optional

The number of movements. The default is defaultZoomMount.

See:

zoomOut(amount)

Scale the amount in the opposite direction to the camera view vector.

Name Type Description
amount Number optional

The number of movements. The default is defaultZoomMount.

See:

Type Definitions

FlightCancelledCallback()

The function that will be executed when the flight is cancelled.

FlightCompleteCallback()

The function executed upon completion of the flight.