# orbitControl()

### Example

<div><figure><img src="https://768248463-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqbs7pgU3AVBY06Rl9M31%2Fuploads%2FpMEIbfb4b7C5KfaTvHg9%2Forbit%20rotate.gif?alt=media&#x26;token=eceadd4f-ba41-4949-a312-a1a421fbd712" alt=""><figcaption></figcaption></figure> <figure><img src="https://768248463-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqbs7pgU3AVBY06Rl9M31%2Fuploads%2FLj51YD25aoeVEXd53SW6%2Forbit%20translate.gif?alt=media&#x26;token=3dc70f8c-9d8a-440f-9690-d5e6835fc24b" alt=""><figcaption></figcaption></figure> <figure><img src="https://768248463-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fqbs7pgU3AVBY06Rl9M31%2Fuploads%2FyxMuTDnvB2QQKXocj5n3%2Forbit%20zoom.gif?alt=media&#x26;token=bb3c0310-f134-4fd9-9cce-fd641f1a2572" alt=""><figcaption></figcaption></figure></div>

### Syntax

```
orbitControl([sensitivityX], [sensitivityY], [sensitivityZ])
```

<table><thead><tr><th width="136">Parameter</th><th>Description</th></tr></thead><tbody><tr><td>sensitivityX</td><td>sensitivity to mouse movement along the x-axis</td></tr><tr><td>sensitivityY</td><td>sensitivity to mouse movement along the y-axis</td></tr><tr><td>sensitivityZ</td><td>sensitivity to mouse movement along the z-axis</td></tr></tbody></table>

### Description

Allows movement around a 3D sketch **using a mouse or trackpad**.

* **Left-clicking** and dragging will **rotate** the camera position **about the center of the canvas** (not necessarily `0, 0, 0`, as you might have moved your camera before)
* **Right-clicking** and dragging will **shift** the camera position without rotation
* **Rolling the mouse wheel or the trackpad** (scrolling) will move the camera **closer or further from the center of the canvas.**

This function can be called with parameters dictating sensitivity to mouse movement along the X and Y axes. Calling this function without parameters is equivalent to calling `orbitControl(1,1)`. **To reverse direction of movement** in either axis, enter a negative number for sensitivity.

{% hint style="info" %}
Find these documents helpful? Let the people who made them help your child learn to code at [**Strivemath**](https://www.strivemath.com/)<mark style="color:blue;">**!**</mark>

We'd love to hear your Feedback/Comments [here](https://docs.google.com/forms/d/e/1FAIpQLSeqorBAGTya-YBRI-VFjJxtgQtCz3ucGDI96K96sNyuaGuvdw/viewform?usp=sf_link).
{% endhint %}
