You are reading the documentation for the version 2 of the ShapeDiver viewer API. Free support for this viewer version will be discontinued on June 1st, 2024.

Please refer to the version 3 documentation here. See also the migration guide from version 2 to version 3 here.

Class: CameraApi

api.scene.camera

ShapeDiver Viewer - Camera API

Methods

animateAsync(path [, transition])

Animate camera along a path

Parameters:
Name Type Argument Description
path Array.<CameraDefinition>

Array of camera definition objects defining a camera path

transition TransitionParameters <optional>

Definition of the parameters to use for the transition (tween)

Returns:
Type Description
Promise.<APIResponse>

APIResponse with a CameraDefinition according to the camera's final position.

get()

Returns the position and target of the camera as a CameraDefinition. If no target is available for this type of camera, the property target is undefined.

Inherited From:
Overrides:
Returns:
Type Description
CameraDefinition

The current camera definition

resetAsync( [transition])

Reset camera to its currently configured default configuration

Parameters:
Name Type Argument Description
transition TransitionParameters <optional>

Definition of the parameters to use for the transition (tween)

Returns:
Type Description
APIResponse

APIResponse with a CameraDefinition of the camera's default definition.

updateAsync(camera [, transition])

Update camera

If target and/or position are provided, the camera will be moved to its new orientation

Parameters:
Name Type Argument Description
camera CameraDefinition

The new camera properties

transition TransitionParameters <optional>

Definition of the parameters to use for the transition (tween)

Returns:
Type Description
Promise.<APIResponse>

APIResponse with a CameraDefinition according to the new properties.

zoomAsync( [scenePaths] [, transition])

Zoom to show some or all objects in the scene

Parameters:
Name Type Argument Description
scenePaths Array.<ScenePathType> <optional>

The paths of the scene which the camera should capture. If none are provided, the camera will zoom to the scene extents.

transition TransitionParameters <optional>

Definition of the parameters to use for the transition (tween)

Returns:
Type Description
Promise.<APIResponse>

APIResponse with a CameraDefinition of the camera's new orientation.

Members

<readonly> TYPE :CameraType

Enum for camera types.

Type:
Properties:
Name Type Default Description
PERSPECTIVE CameraType 0

perspective camera

TOP CameraType 1

orthographic camera, top view

BOTTOM CameraType 2

orthographic camera, bottom view

RIGHT CameraType 3

orthographic camera, right view

LEFT CameraType 4

orthographic camera, left view

BACK CameraType 5

orthographic camera, back view

FRONT CameraType 6

orthographic camera, front view

AR CameraType 7

AR camera

<inner> _api :ApiInterfaceV2

Type:

<inner> _apiResponse :APIResponse

Type:

<inner> _getCameraDefinition :function

Type:
  • function

<inner> _threeDManager :module:ThreeDManagerDefault~ThreeDManager

Type:
  • module:ThreeDManagerDefault~ThreeDManager

<inner, constant> CameraApiInterface :module:CameraApiInterface~CameraApiInterface

Type:

Type Definitions

CameraDefinition

The camera definition as the position and target as Point3d.

Type:
  • Object
Properties:
Name Type Description
position Point3d

The position of the camera in the scene

target Point3d

The position of the target in the scene

Overrides:

CameraType

The camera type, see TYPE for values

Type:
  • Number

TransitionParameters

Definition of a transition function for camera movements

Type:
  • Object
Properties:
Name Type Argument Default Description
duration Number <optional>
1000

duration of the transition in milliseconds

easing String | function <optional>
'Quartic.InOut'

In case a string S is provided, the corresponding easing function TWEEN.Easing[S] will be used if it exists. The easing function may also be passed directly, e.g. one of the many provided by Tween, see also TweenExplained, or a manually defined one.

interpolation String <optional>
'CatmullRom'

In case a string S is provided, the corresponding interpolation function TWEEN.Interpolation[S] will be used if it exists. Tween supports Linear, Bezier, and CatmullRom.

coordinates String <optional>
'cylindrical'

Defines coordinate system to use for animated camera paths. One of 'spherical' or 'cylindrical'.

ShapeDiver 3D Viewer, Copyright © 2015-2018 ShapeDiver GmbH. Documentation generated by JSDoc 3.5.5 on Tue Jan 8th 2019 using the DocStrap template.