--- title: OrbitControls description: How to use OrbitControls to interact with the scene. author: alvarosabu thumbnail: /recipes/orbit-controls.png difficulty: 1 --- # OrbitControls [OrbitControls](https://threejs.org/docs/index.html?q=orbit#examples/en/controls/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/addons/controls/OrbitControls` module. This creates a problem because **TresJS** automatically creates a catalog of the core of Three so you can use them as components. Fortunately, **TresJS** provides a way to extend the catalog of components. You can do it by using the `extend` method from the core library. For more information about extending your TresJS catalog, refer to the [extending](/advanced/extending.md) section. ## Using OrbitControls To use `OrbitControls` you need to import it from the `three/addons/controls/OrbitControls` module. ```js import { OrbitControls } from 'three/addons/controls/OrbitControls' ``` Then you need to extend the catalogue of components using the `extend` method. ```js import { extend } from '@tresjs/core' import { OrbitControls } from 'three/addons/controls/OrbitControls' extend({ OrbitControls }) ``` Now you can use the `TresOrbitControls` component in your scene. ::: code-group ```vue [OrbitControls.vue] ``` ::: Since [OrbitControls](https://threejs.org/docs/index.html?q=orbit#examples/en/controls/OrbitControls) needs a reference to the camera and the renderer. You need to pass those as arguments. You can use the [useTresContext](/api/composables#usetrescontext) composable to get the camera and the renderer. ::: warning `useTresContext` can be only be used inside of a `TresCanvas` since `TresCanvas` acts as the provider for the context data. Thats why we created a subcomponent called `OrbitControls.vue`. See more about [context](/api/composables#usetrescontext). ::: ```ts import { useTresContext } from '@tresjs/core' const { camera, renderer } = useTresContext() ``` So the final code would be something like this: ::: code-group ```vue [OrbitControls.vue] ``` ```vue [App.vue] {3,12} ``` ::: ## OrbitControls from `cientos` Here is where the fancy part begins. ✨ The `cientos` package provides a component called `` which is a wrapper of the `OrbitControls` from the [`three-stdlib`](https://github.com/pmndrs/three-stdlib) module. The nicest part? You don't need to extend the catalog or pass any arguments. It just works. 💯 ```vue {3,12} ```