Skip to content

OrbitControls

Orbit controller based on three/addons. Automatically hooks into the render loop after installation.

Usage

ts
import { create3dApp } from '@threeuse/core'
import { OrbitControls } from '@threeuse/core/plugins'

const app = create3dApp()
app.use(OrbitControls, {
  enableDamping: true,
  dampingFactor: 0.05,
})

app.$orbitControls // OrbitControls instance

Options

OptionTypeDefaultDescription
enableDampingbooleantrueEnable damping (inertia)
dampingFactornumber0.05Damping coefficient
enableZoombooleantrueEnable zoom
enablePanbooleantrueEnable panning
autoRotatebooleanfalseAuto rotate
autoRotateSpeednumber2Auto rotate speed

Demo

拖拽旋转 · 滚轮缩放 · 右键平移

Released under the MIT License.