Implementing a custom drag event function in JavaScript and THREE.js