Select Page
Tech Log #029: Drag & drop works

Tech Log #029: Drag & drop works

The drag & drop functionality now works! Check out the gif. By a count, about 8 methods were tried before reaching one that worked. Thought about the problem a bit differently, broke it down into tiny steps, and with a bit of tinkering, it works.
Dragging the square to the marker makes the marker change to green. Moving the marker to the square also makes it change to green.
One of the methods that was close to working but not quite was aframe-mouse-dragndrop. I made some changes, which are viewable in this git diff. Main change was line 76: .add(this.direction.clone().multiplyScalar((this.dist + this.range) * ((-1*zPos)-1) ));. The other big changes were thanks to bknill for the initial parented entities fix.
The next step is to clean up the code that works, and integrate it with the ‘full’ codebase. After that, continue with the device hardware. There are plenty of ways to make it even better, but for now the aim is to make a complete working prototype.