Socket
Book a DemoInstallSign in
Socket

drag-controls-tnny

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

drag-controls-tnny

Drag controls for https://github.com/mrdoob/three.js with support for ES6 import

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

three-dragcontrols

Drag controls for https://github.com/mrdoob/three.js with support for ES6 import

Inspired by https://github.com/yomotsu/camera-controls to create the ES6 module

Installation

npm install drag-controls

Usage

import * as THREE from 'three'
import DragControls from 'drag-controls'

DragControls.install({THREE: THREE})

var objects = []
// init threejs scene
const camera = new THREE.PerspectiveCamera(60, width / height, 0.01, 1000)
const renderer = new THREE.WebGLRenderer()
// set renderer size and append domElement to the desired conponent
// add some meshes to the scene and the 'objects' array

const dragControls = new DragControls(objects, camera, domElement)

// you may also want to add an mouse move event listener to render when moving objects
renderer.domElement.addEventListener("mousemove", function() {
    renderer.render(scene, camera)
});

Keywords

three

FAQs

Package last updated on 16 Nov 2021

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