🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

camera-controls

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

camera-controls

A camera control for three.js, similar to THREE.OrbitControls yet supports smooth transitions and more features.

2.10.1
latest
Version published
Weekly downloads
512K
10.36%
Maintainers
2
Weekly downloads
 
Created

What is camera-controls?

The camera-controls npm package provides a set of controls for manipulating a camera in a 3D scene, typically used with Three.js. It offers a variety of features to control the camera's position, rotation, and zoom, making it easier to navigate and interact with 3D environments.

What are camera-controls's main functionalities?

Orbit Controls

Orbit controls allow the camera to orbit around a target point. This is useful for inspecting objects from different angles.

const cameraControls = new CameraControls(camera, renderer.domElement);
cameraControls.update();
// To rotate the camera around a target
cameraControls.rotate(0.1, 0.1);

Dolly (Zoom) Controls

Dolly controls enable zooming in and out of the scene. This is useful for getting a closer look at objects or zooming out to see the entire scene.

const cameraControls = new CameraControls(camera, renderer.domElement);
cameraControls.update();
// To zoom in or out
cameraControls.dolly(0.5, true);

Pan Controls

Pan controls allow the camera to move horizontally and vertically. This is useful for navigating across a scene without changing the camera's orientation.

const cameraControls = new CameraControls(camera, renderer.domElement);
cameraControls.update();
// To pan the camera
cameraControls.truck(0.5, 0.5, true);

Smooth Transitions

Smooth transitions enable the camera to move smoothly from one position to another. This is useful for creating cinematic movements and improving user experience.

const cameraControls = new CameraControls(camera, renderer.domElement);
cameraControls.update();
// To smoothly transition to a new position
cameraControls.setLookAt(0, 0, 10, 0, 0, 0, true);

Other packages similar to camera-controls

FAQs

Package last updated on 09 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts