Elastic collisions in 3D using three.js