Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

camera-controls

Package Overview
Dependencies
Maintainers
0
Versions
138
Alerts
File Explorer

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.9.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
231K
decreased by-6.66%
Maintainers
0
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

Keywords

FAQs

Package last updated on 17 Aug 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc