loading...
running...
How to use
Pick a preset or build your own jelly: choose the lattice size, stiffness, shear and bend factors and damping. Press Reset to drop it again, Kick to launch it upward, or drag any node with the mouse (2D) to stretch it. Tick Draw springs to see the lattice. Turn on the shaking table and slide the frequency to find the resonance of a tall body. Drag to orbit, wheel to zoom. Space pauses, R resets.
Experiments: (1) double k and see the node frequency rise by sqrt 2; (2) set the shear factor to 0 and watch the block collapse sideways; (3) pin the top row for a curtain and shake it; (4) raise damping to see pudding instead of jelly.
The kitchen counter, serving tray, rim, plate, glass dome, spoon and other props were modelled in Blender 5.2 with baked PBR textures and exported as a Draco GLB. The jelly itself is a live surface mesh built every frame from the lattice nodes of the same mass-spring model as the 2D page.
The science
A soft body is modelled as a lattice of point masses joined by springs: the classic mass-spring model. Every spring between nodes i and j exerts a force along its direction u with a Hookean part and a dashpot part:
F_i = -[ k (|x_i - x_j| - l0) + c (v_i - v_j) . u ] u
Structural springs join neighbours, shear (diagonal) springs resist skewing, and bend springs two nodes apart resist folding; the sliders scale their stiffness relative to k. Total mass is split equally between the nodes, so the node mass is m = M / N and the natural node frequency is sqrt(k/m) / 2 pi. The damping coefficient is written as a damping ratio, c = 2 zeta sqrt(k m).
Integration. Newton's second law for each node, m a = sum F + m g, is advanced with semi-implicit (symplectic) Euler at 2400 sub-steps per second. This scheme does not gain energy artificially: an undamped body keeps its total energy bounded, which is one of the checks below. Stiffer springs need smaller steps (stability needs omega dt < 2).
Contacts. The floor and tray walls are penalty springs, F_n = k_c (penetration) - c_c v_n, with Coulomb friction F_t = -mu F_n tanh(v_t / v0). The tray can be shaken sinusoidally; a tall jelly has its own lowest bending frequency and a large response when the table frequency matches it.
What the colours mean. Each cell is coloured by the mean strain (l - l0)/l0 of its springs: blue is compression, red is stretch.
Simplifications. Point masses with no volume preservation (a real jelly is nearly incompressible, a mass-spring lattice is not), isotropic springs on a regular lattice (the elastic response is slightly direction dependent), no tearing, no self-collision. Behaviour depends on the lattice resolution, as in every discretised model. Use it for intuition about waves, damping, resonance and contact, not as a finite-element solver.
In-page checks. (1) The period of a two-node spring-mass pair against 2 pi sqrt(m_reduced / k). (2) Energy drift of an undamped, pre-stretched body in free fall. (3) The static compression of a standing chain against m g n (n-1) / (2k). (4) The speed of a compression pulse along a chain against h sqrt(k/m). (5) With no external force the centre-of-mass velocity does not change.