I need a bunch of balls bouncing in 3d, in javascript. They must bounce off each other.
Here is the working code for 2d collsions:
[login to view URL]
I believe the 3D version of this and the equations are here, it mentions calculating Z first:
[login to view URL]
You can use the jsFiddle, but I need the Z component added.
The Z can be shown as the size of the ball (bigger=closer).
I will need to test this code to make sure the Z works right (in a 3d software) since it's hard to tell in 2d. It will take me less than 1 hour to test it.