question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

THREE.DragControls

See original GitHub issue

The idea for a drag control has been lingering for sometime (had the impression that some were also requesting for this feature), so thanks to @chandlerprall for suggesting the possibly of a “plane-less” moving of objects in issue #1514, I’ve implemented a THREE.DragControls as illustrated in here.

http://jsfiddle.net/S6Gq9/1/

to use it, one simply have to add

// activate Drag Controls
var dragcontrols = new THREE.DragControls(camera, scene, renderer.domElement); 

one benefit of the planeless version is that its much easier to “inject” into most scenes without adding additional planes" (for example with use with ThreeInspector, and another benefit is that you get less errors when the invisible plane surface is not large enough (esp at the corners of the page).

any other suggestions or bugs with this? perhaps we could have an activate/deactivate function like dragcontrols.activate() and dragcontrols.deactivate()?

Issue Analytics

  • State:closed
  • Created 12 years ago
  • Comments:16 (11 by maintainers)

github_iconTop GitHub Comments

5reactions
sensor111commented, Apr 1, 2016

Would be nice to refresh jsfiddle inks cos seams they doesn’t work properly any more - no cubsc only text in output window

4reactions
whatnextcommented, Aug 30, 2017

Hello 😃 I just wanted to point out I created a controller which allows drag rotation of individual objects. Mine uses the position of the mouse click as the center of rotation and locks to a set of rotation axes (by default) along/perpendicular to line of sight. It also works with touch. Just in case anyone is interested… you can read about it and get the code here: https://virtual.blue/point-drag-controls. I haven’t tested it too much so it might be a bit rough round the edges. Would be interested in any feedback 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

DragControls – three.js docs
EventDispatcher →. DragControls. This class can be used to provide a drag'n'drop interaction. Code Example. const controls = new DragControls( objects, ...
Read more >
DragControls - Three.js Tutorials
Used to provide drag and drop interaction for your scene objects. <>. Lesson Scripts ./dist/client/index.html ...
Read more >
keqingrong/three-dragcontrols - GitHub
import { Scene, PerspectiveCamera, WebGLRenderer, BoxGeometry, MeshBasicMaterial, Mesh } from 'three'; import DragControls from 'three-dragcontrols'; ...
Read more >
What are DragControls in three.js? - Educative.io
Three.js is a JavaScript library that is built on top of WebGL and is used to render ... const controls = new DragControls(objects,...
Read more >
three-dragcontrols - npm
three.js DragControls. Latest version: 0.88.2, last published: 5 years ago. Start using three-dragcontrols in your project by running `npm i ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found