Right now I have a scene with two spheres and a point light at (0,0,0). The spheres rotate around the point using Controls, but I can't get the spheres to move when I attempt to drag them. Can someone give my code a quick look, thanks!
EDIT: Yes they move, but I need them to be draggable independently from the THREE.Controls, just like this example: http://mrdoob.github.com/three.js/examples/webgl_interactive_draggablecubes.html
When a sphere is SELECTED, i need to prevent THREE.Controls() and drag that sphere wherever I want without 'rotating' the scene.
http://jsfiddle.net/bmd0031/MhB2u/3/
Brent
What you need to do is disable the controls dynamically based on whether your object is selected.
So here are the controls I am using:
Now the controls objects in THREE.JS create mouse events that allow them to change the camera view. What we want is to disable the controls when we have an object selected, otherwise allow the controls to change the view when we drag.
In order to do this we can declare a global variable that will act as a flag
This will be set to true when we click and cast a ray, if the ray collides with our specified object we will set killControls true.
And in our main animation loop, the following conditional will cause the controls to only be updated when we click and do not collide with our specified object:
EDIT: I got to looking at this today when this answer got upvoted and looking at this last block of code above I decided I think this is clearer so I changed to this in my code, of course both the below and above are equivalent: