> For the complete documentation index, see [llms.txt](https://learnpython.strivemath.com/p5-python-web/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learnpython.strivemath.com/p5-python-web/reference/3d-controls/orbitcontrol.md).

# orbitControl()

### Example

<div><figure><img src="/files/GJUleuRrayNreEKmY41K" alt=""><figcaption></figcaption></figure> <figure><img src="/files/Ag3FCHhUEtWafxuG1FPA" alt=""><figcaption></figcaption></figure> <figure><img src="/files/EfFLxNVQ1tKnGNeHblFH" 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 %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://learnpython.strivemath.com/p5-python-web/reference/3d-controls/orbitcontrol.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
