How to create snapping effect and collision detection between two objects?

Am using Vec3 for the active object, I am able to detect the collision but could not implement snapping effect like http://jsfiddle.net/gcollect/FD53A/
P.S we are using 3D objects.

I’ve used box3 successfully for this.
It creates a bounding box for your object which you can parent to your object and compare boundary intersections etc

How to handle that bounding box when the object has diagonal movement?

Check out

https://threejs.org/docs/#api/en/math/Box3.intersect

That’s how you compare

Also learn from this…
http://man.hubwiz.com/docset/HTML.docset/Contents/Resources/Documents/developer.mozilla.org/en-US/docs/Games/Techniques/3D_collision_detection/Bounding_volume_collision_detection_with_THREE.html

Actually, the intersection is already working, am unable to create a magnetic effect in between active and colliding object only in one scenario; when the active object is moving in a diagonal direction (x and z axis, simultaneously ), besides it is working perfectly against x and z-axis.
It would be great if i can find any general solution, not necessorly in Threejs.

Code it so that when intersection occurs…
A new function drives the animation of a for loop from the current location to the intersecting object’s location.

I have the exact code you want.
I just have to dig it up.
Give me a bit and I’ll have something for you
Possibly

Also,if you’re not looking strictly in three.js, there are solutions to this in unreal and other engines.

I will be grateful, Thanks.
If i get general solution using coordinates, i can use it in Threejs, that won’t be big deal.

Did you happen to find any solution?