POV-Ray : Newsgroups : povray.binaries.images : Cloth experiment : Re: Cloth experiment Server Time
17 Aug 2024 00:13:13 EDT (-0400)
  Re: Cloth experiment  
From: Chaps
Date: 30 Nov 2001 10:00:42
Message: <3c079f1a$1@news.povray.org>
"David Buck" <dav### [at] simberoncom> wrote in message
news:3C0### [at] simberoncom...
> Do you have damping on your springs? If not, they will explode out of
> control.  The damping force is opposite in direction to the relative
> velocity of particles at the ends of the spring.  If you still have
> problems, let me know.

The algorithm I am using is this one:

 InitStrength();                                      // reset all force
vector to 0 at each node of the cloth
 ApplyStrengthField(fClock,fStep);        // Today it is only a constant
strength field: gravity F = M*g
 ApplyStrength(fClock,fStep);                // for each vertex, add new
forces for each "wires" of the cloth,
                                                             // = (wire
enlargement/initial wire length)*wire direction using
                                                             // elasticity
ratio
 ApplyWind(fClock,fStep);                     // for each triangle,
calculate the dot product of triangle nomal by
                                                             // (triangle
speed + local wind(today 0)); then multiply by normal
                                                             // and add to
each vertex force using permeability ratio
 TempVertex = new cVector[iNbVertex];  // create a new set of vertex to
evaluate next cloth position
 ForcedMove(fClock,fStep);                    // nothing today, for next
evolution: points with fixed paths
 FreeMove(fClock,fStep);                        // evaluate TempVertex[i] =
Vertex[i] + (Speed[i]*fViscosity
                                                              // +
Strength[i]*fStep/Weight[i])*fStep; were fStep is the time
                                                              // step
between 2 frames. I think that the damping you are
                                                              // speaking
about is the viscosity ratio - I am using numbers
                                                              // between 0.9
and 0.97
 Check(pObjectNext);                              // check and modify all
point position, checking them with a list
                                                              // of objects
pointed by pObjectNext
 UpdateSpeed(fStep);                              // calculate speed at each
point: (TempVertex-Vertex)/fStep
 Copy();                                                   // copy
TempVertex in Vertex
 delete TempVertex;
 NormalUpdate();                                     // calculate new normal
vectors at each vertex. This function is
                                                               // used only
for output in mesh2 format.


>
> David Buck
> Simberon Inc.
> www.simberon.com


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.