Examples Orbit Control

Orbit Control

Orbit control uses mouse or touch input to adjust camera orientation in a 3D sketch. To rotate the camera, left click and drag a mouse or swipe on a touch screen. To pan the camera, right click and drag a mouse or swipe with multiple fingers on a touch screen. To move the camera closer or further to the center of the sketch, use the scroll wheel on a mouse or pinch in/out on a touch screen.

Orbit Control: Revised by Caleb Foss. Edited and maintained by p5.js Contributors and Processing Foundation. Licensed under CC BY-NC-SA 4.0.

You can find the code history of these examples here: pre-2023 example, 2023 code. You can suggest improvements by contributing to the current website!