flag-cloth

Aerodynamic wind

Wind pressure is distributed through cloth triangles instead of setting vertex positions.

Every cloth cell contains two triangles. For each triangle the solver calculates two edges, their cross product, and an unnormalized normal whose length represents twice the triangle area. It compares the local wind velocity with that normal and distributes pressure across the three particles.

flag.setWind({
  direction: [1, 0.1, 0.2],
  strength: 9,
  turbulence: 0.42,
  gustFrequency: 0.55,
  spatialScale: 1.4,
  aerodynamicCoefficient: 0.35,
});

Turbulence uses a small internal hash/value-noise field. Noise varies wind force; it never directly changes particle positions.

For a calm banner, lower strength and turbulence. For sharp folds, raise turbulence gradually before increasing simulation resolution.