Elastic ball collisions - 3D box

Spheres of different mass bounce in a glass box; wall and ball restitution decide how fast the energy drains away. Drag to orbit, scroll to zoom.

Switch to 2D

Presets

Playback

Physics

Balls

Quality

Model checks

The science

Impulse model

The 2D page and this page share one collision module. Between impacts each ball falls with a = −g. A wall hit reverses the normal velocity and multiplies it by the wall restitution ew. For two spheres with masses m1, m2 (mass ∝ r³, the volume of a sphere) and relative normal speed vn the impulse is J = −(1 + e) vn / (1/m1 + 1/m2) applied along the line of centres, so total momentum is conserved and the kinetic energy lost equals ½ (1 − e²) μ vn² with reduced mass μ. With e = 1 and no walls, kinetic energy is conserved as well.

Bounce envelope

A ball dropped from height h0 rebounds to hn = ew2n h0 after n floor hits.

Honest simplifications: frictionless spheres (no spin), mass-weighted overlap correction instead of continuous collision detection, fixed 1/240 s sub-steps, no air drag. Because walls are lossy (ew < 1), the total-energy readout only stays constant with the Perfectly elastic preset.

What to try
  • Use Perfectly elastic: kinetic plus potential energy stays constant (check the energy graph).
  • Use Zero gravity gas: the speed histogram relaxes towards a thermal-like shape.
  • Drop the tagged ball (white ring) and compare the rebound heights with ew2n h0.
Energy bookkeeping
Speed distribution
Tagged ball height
Made with 🟠 Blender · Three.js