Cloth Simulation

Real-time cloth simulation with draggable corners; tweak gravity and wind

Cloth Physics

Left-click and drag to interact β€’ Right-click to tear (if enabled)

Controls

Stats

Points:961
Constraints:1,800
Gravity:0.50
Wind:0.0
Running:Yes

About Cloth Simulation

Real-Time Physics Simulation

Experience a real-time cloth physics simulation using Verlet integration and constraint solving. The cloth is made up of 961 points connected by 1,800 constraints, creating realistic fabric behavior.

Features

  • 961 simulation points (31x31 grid)
  • 1,800 distance constraints
  • Verlet integration for physics
  • Adjustable gravity (0-2)
  • Wind force (-5 to +5)
  • Draggable cloth interaction
  • Tearable cloth mode
  • Pinned corners (red dots)
  • Real-time rendering
  • Constraint solving (3 iterations)

Controls

  • Left Click + Drag: Pull and interact with cloth
  • Right Click: Tear cloth (if tearable mode is on)
  • Gravity Slider: Adjust downward force
  • Wind Slider: Add horizontal wind force
  • Play/Pause: Control simulation
  • Reset: Restore initial state

Physics Algorithm

  • Verlet Integration: Position-based dynamics
  • Constraint Solving: Distance constraints between points
  • Damping: 0.99 velocity damping for stability
  • Collision: Canvas boundary constraints
  • Iterations: 3 constraint solving passes per frame

Use Cases

  • Physics simulation learning
  • Game development prototyping
  • Soft body dynamics study
  • Interactive demonstrations
  • Canvas animation experiments