16 minutes ago, Fulcrum.013 said:or interpenetration elimination algo bring a additional energy to systems.
Yes this is my problem. I use capsules, scaled down along their axis so the spherical cap becomes more flat to approximate skin curvature. The capsules are long so they go deep under the skin. Cloth penetration is always resolved along the axis of the capsule they intersect. When the character bends the knee, the capsules form self intersection and trapped cloth vertices penetrate with many capsules. Because of the naive penetration resolve they do not converge, even if i use the average of all resolved positions.
The second problem is when cloth points get stuck in the sink formed by adjacent capsules, the average of all resolutions may project the point outside the collision shapes, adding energy, and doing it serially my project it inside a neighboring capsule, so adding energy in the next step.
Maybe i can improve this by considering velocities when choosing the resolving direction, but likely the problem can never be solved completely. The right way would be to use the skin triangles, but that's more expensive and skin self intersection would cause much worse behavior. Also it becomes difficult to resolve properly when the cloth point is deep inside the skin, you would want something like tetrahedrons to represent in/outside robustly. So my system ends up more robust in practice even i do it wrong. It's just cloth simulation, so a graphical effect and i allow myself to cheat here. You really need to zoom in to detect the jitter - it's acceptable, but i still always see jitter as a proof of my failure.
Avoiding penetration completely would be totally unpractical for cloth - too small timesteps, how to deal with self intersection?... would never work robustly under realtime constraints i think.
But cloth sim is not really my priority - did it just for fun, likely i'll never use it...
2 minutes ago, Dirk Gregorius said:This is clearly wrong! Angles are not preserved under non-uniform scaling. The closest point to a circle is not necessarily the closest point to an ellipse after re-scaling back!. See example below.
I think he meant tracing a ray here, not to find the closest point.