One of my first 'eye catcher' projects. I made a tool to give a realistic cloth behavior to a given geometry.
All this work was done at a very low level (at geometry vertex level) so it is easily replicable in many environments.
Essentially, this tool captures quads from the supplied mesh and constructs a mesh of springs
that move through a mass-spring system, simulated using a symplectic Euler integrator.
Spring Structure
When filling our geometry with springs, it's crucial to define how these springs will be created, as they ultimately determine the various properties of the mesh.
Commonly, in the field of structural engineering, it is specified whether a spring is functioning under tension ('Extend springs') or compression ('Bending springs'). This same principle is applied in constructing the mesh.
In the videos, you can observe how this spring configuration impacts the mesh behavior.
Interactivity
As is always the case when working on an effect or tool implementation, it is crucial to consider how this effect will interact with the various elements in the scene.
Wind
There are so many ways to implement wind on a fabric since it is a force applied at the nodes of our simulation. However, a 'hack' has been chosen to enhance realism.
In this tool, wind is calculated per triangle, and the wind force is applied depending on the orientation formed by the three vertices.
Collisions
One of the most natural ways to interact with an object in life is through collision. To achieve this effect, collision resolution has been implemented implicitly.
This approach allows for much more realistic outcomes than those obtained by applying penalty forces or symplectic Euler methods.
Bonus
A brief excerpt from the entire journey (weeks in those days) leading up to the tool's implementation. While this project may not be the most technical or the most cutting-edge, I am undoubtedly very pleased with the outcome.
Links
Here the GitHub source code. will be released soon...