Skip to content

viewport

Camera controls and viewport settings.

5 functions / 0 types

Modules

Index

FunctionDescription
getExposureThe exposure one viewport camera draws at, as an EV100.
getSkyboxVisibleRead whether a viewport shows the scene’s skybox.
setExposureSet how much light viewport cameras let in, as an EV100.
setSkyboxVisibleShow or hide the scene’s skybox in a viewport. A viewport never set shows it.
setViewCubeModelSet a custom glTF binary model for the view cube in every viewport.

getExposure

getExposure(args?: { viewport?: string }, transactionId?: string): Promise<number>

The exposure one viewport camera draws at, as an EV100.

Reads the exposure reached so far while a change eases. A camera never given an exposure reads as 9.7, the exposure it draws at.

Fails unless exactly one viewport camera matches viewport.

Returns Promise<number>.

viewport optional : string

Label of the viewport to read. Absent, the only viewport is read.

transactionId optional : string

getSkyboxVisible

getSkyboxVisible(args?: { viewport?: string }, transactionId?: string): Promise<boolean>

Read whether a viewport shows the scene’s skybox.

Fails with InvalidArgument unless exactly one viewport matches viewport.

Returns Promise<boolean>.

viewport optional : string

Label of the viewport to read. Absent, the only viewport.

transactionId optional : string

setExposure

setExposure(args: { durationSeconds?: number; ev100: number; viewport?: string }, transactionId?: string): Promise<void>

Set how much light viewport cameras let in, as an EV100.

Acts on every viewport camera whose label is viewport, or on all of them when it is absent. Lower is brighter, and each step of one halves or doubles the light let in. A scene lit by sunlight in lux suits about 14. A camera never given an exposure draws at 9.7.

Fails without changing anything when ev100 is not a finite number.

Returns Promise<void>.

durationSeconds optional : number

Seconds to ease from the current exposure to ev100, in even steps of EV100 with a gentle start and end. Absent, zero, negative or non-finite sets it at once. A new call stops an easing in progress and starts from the exposure that easing had reached.

ev100 : number

The exposure as an EV100.

viewport optional : string

Label of the viewports to change. Absent, every viewport changes.

transactionId optional : string

setSkyboxVisible

setSkyboxVisible(args: { viewport?: string; visible: boolean }, transactionId?: string): Promise<void>

Show or hide the scene’s skybox in a viewport. A viewport never set shows it.

Fails with InvalidArgument when no viewport matches viewport.

Returns Promise<void>.

viewport optional : string

Label of the viewports to change. Absent, every viewport.

visible : boolean

Show the skybox, or draw black behind the scene.

transactionId optional : string

setViewCubeModel

setViewCubeModel(args?: { model?: string }, transactionId?: string): Promise<void>

Set a custom glTF binary model for the view cube in every viewport.

Node names define camera targets: face_+x for a face, edge_+x+y for an edge, and corner_+x+y+z for a corner. Nodes with other names are visible but do not respond to clicks.

The model is rendered unlit.

Returns Promise<void>.

model optional : string

Base64-encoded glTF binary. Omit to restore the built-in cube.

transactionId optional : string