I need to drag a 3d object using mouse. The 3d objects has its face coloured and edges shown.The problems I am facing are:
1.I want to move the 3d objects and the edges together. Now, either the 3D object with face or the edges only moves, not both.
2. Even the mouse is clicked it doesnt deselect the object.It keeps on following the mouse cursor.
I have added the code snippet here .But still it doesnt work as expected.
I am using DragControls instead of raycaster. Is it the reason why it is not working for me?
Yeah, DradControls internally perform this internally. var intersects = _raycaster.intersectObjects( _objects, true );
It means that it traverse the objects and picks their childrend too. From my point of view, it’s confusing behaviour. Maybe contols need an additional boolean parameter to turn the traversing of objects on/off.
I don’t have that issue in my example because I dont’ use traversing of objects: var intersects = raycaster.intersectObjects([pyramid]); // without the second parameter
Sir, i got it working. But it doesnt look like dragging a static object. When i am dragging it, it seems like rotating. I have attached 2 screenshots for reference.
Have a look at the base quadrilateral, it is evident.
And @Mugen, i am really glad I asked this question here.Its always good to know three.js is improving everyday and I am on the right path. Cheers. Have a good day.
Hello, what if instead of one plane, there were multiple planes so that pNormal is not constant as written in the code. Please help me with dragging over more than one plane. Thanks.