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