← ⚡ Physics & Mechanics
🧣 Cloth Simulation · Verlet

🧣 Cloth



LMB — drag node
RMB — rotate scene
RMB — rotate · Scroll — zoom · LMB on cloth — drag

🧵 Cloth Simulation — 3D

A realistic cloth draped over a sphere, simulated as a mass-spring network. Wind blows the fabric while you can grab and drag individual points. Watch the cloth ripple, fold and settle naturally.

🔬 What It Demonstrates

Mass-spring system with structural, shear and bend springs. Verlet integration keeps the simulation stable even with large time steps.

🎮 How to Use

Click and drag to grab cloth points. Adjust wind strength and direction. The sphere acts as a collision object — the cloth drapes realistically over it.

💡 Did You Know?

Mass-spring cloth models were introduced by Provot (1995) and are still used in games and film. More accurate models use finite elements, but springs give excellent real-time results.

About this simulation

This simulation models a piece of fabric as a mass-spring network: a 30 by 24 grid of point masses linked by springs that resist stretching, shearing and bending. The cloth hangs from a pole and is advanced in time using Verlet integration, which derives velocity from the difference between a node's current and previous position. After each step the spring constraints are relaxed over twelve iterations, while wind and a moving sphere push the fabric into convincing folds and drapes in real time.

🔬 What it shows

A position-based mass-spring cloth solver. Three families of springs — structural neighbours, shear diagonals and bend links two cells apart — hold the grid together. Verlet integration advances each node, constraints are iteratively relaxed toward their rest length, and nodes that enter the sphere are projected back onto its surface.

🎮 How to use

Sliders set Gravity, Wind X, Wind Z, spring Stiffness, Damping and the collision Sphere radius. Left-click and drag a cloth node to pull the fabric; right-click drags to rotate the camera and scroll zooms. Reset rebuilds the cloth and Freeze pauses the physics.

💡 Did you know?

The mass-spring cloth model was popularised by Xavier Provot in 1995, who added "super-elasticity" limits so the fabric could not stretch unrealistically far — a trick still used in modern game engines.

Frequently asked questions

What is a mass-spring cloth simulation?

It represents fabric as a grid of point masses joined by springs. Here a 30 by 24 grid of nodes is connected by structural, shear and bend springs that resist stretching, shearing and folding. The collective behaviour of these springs produces the ripples, folds and drape you see, without modelling the cloth as a continuous material.

How does the simulation move the cloth each frame?

It uses Verlet integration. Each node stores its current and previous position, and velocity is inferred from the difference between them. Acceleration from gravity and wind is added, then twelve constraint-relaxation passes nudge linked nodes back toward their rest lengths. The frame is split into five physics sub-steps for stability.

What do the sliders control?

Gravity sets the downward pull on every node, while Wind X and Wind Z apply a horizontal force with built-in turbulence. Stiffness controls how strongly springs resist stretching, Damping sets how much energy is lost per step, and Sphere radius changes the size of the moving collision ball the cloth drapes over.

Is the simulation physically accurate?

It is a plausible approximation rather than an exact one. Mass-spring models capture the qualitative look of draping and billowing fabric and are widely used in games and film, but they do not reproduce true material stiffness the way finite-element methods do. The parameters here are tuned for stable, attractive motion rather than measured physical units.

Why are several iterations of constraints needed each step?

Correcting one spring can violate its neighbours, because the nodes are shared. Relaxing the constraints repeatedly — twelve times per step here — lets the corrections propagate through the grid so the whole sheet converges toward a consistent shape. More iterations give a stiffer, more inextensible cloth at the cost of extra computation.

About Cloth Simulation — 3D

This simulation models a piece of fabric using a mass-spring network: a grid of point masses connected by structural, shear, and bend springs that resist stretching, shearing, and folding. Verlet integration advances each node in time by deriving velocity from the difference between current and previous positions, while iterative constraint relaxation keeps the spring lengths near their rest values. Users can observe how changing gravity, wind, stiffness, and damping alters the cloth's drape, ripple, and collision response.

Mass-spring cloth models have been the workhorse of real-time fabric simulation in video games and animated film since the mid-1990s, used everywhere from character clothing in AAA game engines to the flowing capes and flags of blockbuster CGI productions.

Frequently Asked Questions

What is a mass-spring cloth simulation?

A mass-spring cloth simulation represents fabric as a grid of point masses linked by virtual springs. The springs enforce distances between neighbouring nodes — structural springs resist horizontal and vertical stretching, shear springs resist diagonal deformation, and bend springs resist folding. When forces like gravity and wind are applied, the nodes move and the collective spring forces produce realistic folds, ripples, and drape.

How do I interact with the simulation?

Left-click and drag directly on the cloth to pull individual nodes and reshape the fabric. Use the right mouse button to rotate the camera around the scene, and scroll the mouse wheel to zoom in or out. The panel sliders on the left let you adjust Gravity, Wind X, Wind Z, Stiffness, Damping, and the Sphere radius in real time. The Reset button rebuilds the cloth from scratch, and Freeze pauses the physics so you can inspect a frame.

What is Verlet integration and why is it used here?

Verlet integration is a numerical method that computes the next position of a particle from its current and previous positions, implicitly encoding velocity without storing it explicitly. The update rule is: x_new = x + (x - x_prev) * damping + acceleration * dt^2. Because velocity is never stored as a separate variable, energy drift is minimised and the simulation remains stable even with the relatively large time steps needed for real-time performance. This simulation sub-divides each animation frame into five Verlet steps for additional stability.

What are structural, shear, and bend springs?

The 30-by-24 node grid uses three families of springs to mimic the mechanical properties of woven fabric. Structural springs connect immediately adjacent nodes horizontally and vertically, preventing the cloth from stretching along its threads. Shear springs connect diagonal neighbours, resisting in-plane shearing that would let the grid collapse like a parallelogram. Bend springs skip one node in each axis direction and resist the cloth folding sharply along a single edge. Together the three families reproduce the characteristic stiffness hierarchy of real textile weaves.

How does the sphere collision work?

Every constraint-relaxation iteration checks whether any cloth node lies inside the moving sphere. If the distance from a node to the sphere centre is less than the sphere radius plus a small offset (0.15 units), the node is projected radially outward onto the sphere surface. Because this check runs inside the twelve-iteration relaxation loop, the correction propagates to neighbouring nodes through the spring constraints, allowing the cloth to drape smoothly over the sphere rather than clipping through it.

Is this simulation physically accurate?

The simulation captures the qualitative behaviour of real fabric convincingly but is an approximation rather than a rigorous physical model. True cloth mechanics are better described by continuum finite-element methods that account for measured material properties such as Young's modulus and Poisson's ratio. Mass-spring models can exhibit numerical artefacts like unwanted super-elasticity or instability at high stiffness values. Xavier Provot's 1995 paper addressed super-elasticity by clamping spring elongation to at most 10% above rest length — a heuristic this simulation does not apply, trading strict accuracy for interactive responsiveness.

Who pioneered mass-spring cloth simulation?

The foundational work on mass-spring cloth for computer graphics was published by Xavier Provot in 1995 in the paper "Deformation Constraints in a Mass-Spring Model to Describe Rigid Cloth Behaviour." Provot introduced the three-spring-family structure and the post-integration correction step that prevents unrealistic stretching. Earlier work by Breen, House, and Wozny (1994) modelled woven cloth using particle interaction energies, but Provot's spring formulation became dominant due to its simplicity and real-time suitability. Position-Based Dynamics, a successor approach by Muller et al. (2007), further improved stability and is now common in game engines.

What real-world phenomena does this simulation demonstrate?

The simulation reproduces several physically observable textile behaviours: the catenary curve formed by a cloth suspended from two or more fixed points, the way wind-driven oscillations travel as transverse waves across the fabric, the anisotropic stiffness of woven material (stronger along thread axes than diagonally), and the contact draping seen when fabric falls over a convex object. These phenomena are relevant to fashion design, architectural tensile structures, parachute engineering, and the rigging of sails.

What is a common misconception about cloth simulation?

A common misconception is that higher stiffness always produces more realistic results. In mass-spring simulations, very high stiffness values make the system numerically stiff — the springs oscillate so rapidly that the integrator requires extremely small time steps to remain stable, and with fixed step sizes the simulation will explode or vibrate uncontrollably. Real cloth is stiff along its threads but much more compliant out-of-plane; the art of cloth simulation tuning lies in choosing stiffness values that look correct and remain stable at the chosen time step, not in maximising the stiffness parameter.

How is cloth simulation used in engineering and technology today?

Modern applications span several industries. Game engines such as Unreal Engine and Unity include position-based or GPU-accelerated cloth solvers for character garments, flags, and soft-body objects. The film and visual effects industry uses high-fidelity finite-element cloth solvers (e.g., Pixar's Fizt and its successors) to simulate costumes in animated features. In aerospace, parachute and airbag deployment simulations use fluid-structure interaction cloth models. CAD tools for fashion design (CLO3D, Marvelous Designer) let designers drape and fit digital garments before cutting fabric, saving material and reducing prototype cycles.

What are current research frontiers in cloth simulation?

Active research areas include neural cloth simulators that learn fabric behaviour from finite-element datasets and run orders of magnitude faster at inference time, enabling real-time high-fidelity garment simulation on mobile devices. Differentiable cloth simulation — where gradients flow through the physics solver — allows gradient-based optimisation of garment patterns, material parameters, and robot manipulation strategies for textile handling. Researchers are also exploring subspace methods that compress cloth dynamics into a low-dimensional space learned from offline simulations, and coupling cloth with hair, fluid, and rigid bodies in unified simulation frameworks for virtual try-on and augmented reality applications.