You are reading Tres v1 docs. Head over tresjs.org for V2 docs.
Skip to content
On this page

OrbitControls

OrbitControls is a camera controller that allows you to orbit around a target. It's a great way to explore your scene.

However, it is not part of the core of ThreeJS. So to use it you would need to import it from the three/examples/jsm/controls/OrbitControls module.

Here is where the fancy part begins. ✨
The cientos package provides a component called <OrbitControls /> that is a wrapper of the OrbitControls from the three-stdlib module.

The nicest part? You don't need to extend the catalog or pass any arguments.
It just works. 💯

vue
<template>
  <TresCanvas shadows alpha>
    <OrbitControls />
    <TresScene> ... </TresScene>
  </TresCanvas>
</template>

Props

PropDescriptionDefault
makeDefaultIf true, the controls will be set as the default controls for the scene.false
cameraThe camera to control.undefined
domElementThe dom element to listen to.undefined
targetThe target to orbit around.undefined
enableDampingIf true, the controls will use damping (inertia), which can be used to give a sense of weight to the controls.false