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

three-trackballcontrols

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

three-trackballcontrols

A module for using THREE.TrackballControls with nodejs

  • 0.9.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.6K
decreased by-24.42%
Maintainers
1
Weekly downloads
 
Created
Source

three-trackballcontrols

NPM

Dependency Badge

A module for using THREE.TrackballControls with nodejs

Setup and Installation

Installation

npm install three-trackballcontrols or yarn add three-trackballcontrols

Usage

Using as module

Example was using three.js + three-trackballcontrols inside of a very simple React app.

import * as THREE from 'three';
import TrackballControls from 'three-trackballcontrols';

// Assumes there is a `camera` and `renderer` initialized.
const controls = new TrackballControls(camera, renderer.domElement);

// Any manual camera changes should be done first, then update the controls.
camera.position.z = 5;
controls.update();

const animate = function () {
  requestAnimationFrame(animate);

  // Required for updating during animations.
  controls.update();
  renderer.render(scene, camera);
}
animate();

Using with CDN / static hosted three.js

Example uses JSDelivr version, look up the latest URL for using with static hosting.

<script type="module">
  import TrackballControls from 'https://cdn.jsdelivr.net/npm/three-trackballcontrols@0.0.8/index.min.js';

  // Assumes that a `camera` and `renderer` initialized.
  const controls = new TrackballControls(camera, renderer.domElement);

  // Any manual camera changes should be done first, then update the controls.
  camera.position.z = 5;
  controls.update();

  const animate = function () {
    requestAnimationFrame(animate);

    // Required for updating during animations.
    controls.update();
    renderer.render(scene, camera);
  }
</script>

To-Dos

  • Testing

Keywords

FAQs

Package last updated on 02 Oct 2020

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