@threlte/extras

<Gizmo>

A gizmo for snap-to camera controls. The gizmo is rendered on top of the scene using an orthographic camera and controls the camera when clicked.

Component Signature

Props

name
type
required
default
description

animationTask
TaskOptions
no
Options for the task to animate the gizmo when the user clicks one of the handles. By default, this task is added to the `mainStage`.

center
[number, number, number]
no
[0, 0, 0]
The center or target of the control (such as an orbit controller), if it exists.

horizontalPlacement
'left' | 'right'
no
'right'

paddingX
number
no
0
The padding to the edge defined by `horizontalPlacement`.

paddingY
number
no
0
The padding to the edge defined by `verticalPlacement`.

renderTask
TaskOptions
no
Options for the task to render the gizmo scene in the viewport. By default, this happens after the `autoRenderTask`.

size
number
no
128

toneMapped
boolean
no
false
Whether the gizmo should be rendered with tone mapping applied. If set to `true`, the tone mapping declared on `<Canvas>` is used.

turnRate
number
no
2 * Math.PI
Turn animation rate in angles per second

verticalPlacement
'top' | 'bottom'
no
'bottom'

xColor
number
no
0xff3653

yColor
number
no
0x8adb00

zColor
number
no
0x2c8fff