THREE.DragControls

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()?

Author: Fantashit

2 thoughts on “THREE.DragControls

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

  2. 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 🙂

Comments are closed.