![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
I am playing with a cloth model inspired by other post. I have built an
external program that allow to create a mesh2 object, and make it interact
with gravity, wind and elementary objects (spheres, torus...).
I give to this object some properties such as elasticity, visvosity and
permeability. They work as expected, but in limited cases. The worst thing
is with elasticity: when I try to define a piece of cloth that resists to
enlargement, the model become instable.
So far, I am only able to generate kind of marshmallow cloth, like the one
in the picture below.
Is there someone who has some advice on the subject?
Chaps
Post a reply to this message
Attachments:
Download 'mesh2.jpg' (14 KB)
Preview of image 'mesh2.jpg'
![mesh2.jpg](/povray.binaries.images/attachment/%3C3c066bd1%40news.povray.org%3E/mesh2.jpg?preview=1)
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Hi,
"Chaps" wrote in message news:3c066bd1@news.povray.org...
> I am playing with a cloth model inspired by other post. I have built an
> external program that allow to create a mesh2 object, and make it interact
> with gravity, wind and elementary objects (spheres, torus...).
Sounds like an interesting and worthy project; and a good start!
> Is there someone who has some advice on the subject?
I don't know much about it myself, but there are many discussions on cloth
simulation on various pages... One page I've found a good resource for this
sort of thing is the "Good-looking Textured Light-sourced Bouncy Fun Smart
and Stretchy Page" (I love the name!). It's at
http://www.esite-host.com/~rocketmg/. The author has a specific article on
cloth simulation, here:
http://www.esite-host.com/~rocketmg/models/m_cloth.htm.
The site has many introductory articles about general algorithms for things
like particle systems, gravity, collision detection and whatnot. I suggest a
casual visit, at least. ;)
Hope it helps,
-- gilrain
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
> I give to this object some properties such as elasticity, visvosity and
> permeability. They work as expected, but in limited cases. The worst thing
> is with elasticity: when I try to define a piece of cloth that resists to
> enlargement, the model become instable.
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.
David Buck
Simberon Inc.
www.simberon.com
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
I think it should have more "foldings" in order to look more like a cloth.
Push a cloth like yours and you should see how it wrinkles and folds. That
is, if the cloth is rather unelastic, as are most fabrics.
Good luck,
Fernando.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"David Buck" <dav### [at] simberon com> wrote in message
news:3C0### [at] simberon com...
> 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
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Thank you for the answer,
I already look at this site, and find many useful ideas.
Chaps
"gilrain" <joh### [at] murraystate edu> wrote in message
news:3c06a748$1@news.povray.org...
> Hi,
>
> "Chaps" wrote in message news:3c066bd1@news.povray.org...
> > I am playing with a cloth model inspired by other post. I have built an
> > external program that allow to create a mesh2 object, and make it
interact
> > with gravity, wind and elementary objects (spheres, torus...).
>
> Sounds like an interesting and worthy project; and a good start!
>
> > Is there someone who has some advice on the subject?
>
> I don't know much about it myself, but there are many discussions on cloth
> simulation on various pages... One page I've found a good resource for
this
> sort of thing is the "Good-looking Textured Light-sourced Bouncy Fun Smart
> and Stretchy Page" (I love the name!). It's at
> http://www.esite-host.com/~rocketmg/. The author has a specific article on
> cloth simulation, here:
> http://www.esite-host.com/~rocketmg/models/m_cloth.htm.
>
> The site has many introductory articles about general algorithms for
things
> like particle systems, gravity, collision detection and whatnot. I suggest
a
> casual visit, at least. ;)
>
> Hope it helps,
>
> -- gilrain
>
>
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
That is why I would like to simulate a "stonger" piece of cloth!
chaps
news:3c06e4cf@news.povray.org...
> I think it should have more "foldings" in order to look more like a cloth.
> Push a cloth like yours and you should see how it wrinkles and folds. That
> is, if the cloth is rather unelastic, as are most fabrics.
>
> Good luck,
>
> Fernando.
>
>
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Chaps wrote:
>
> "David Buck" <dav### [at] simberon com> wrote in message
> news:3C0### [at] simberon com...
> > 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:
> <snip>
The viscosity you are using is basically air resistance. This helps,
but you are still susceptible to exploding springs. I use the following
(in pseudo-code):
length = sqrt(dot(particle2.location, particle1.location));
undampenedStrength = (length - naturalLength) * springStrength;
normalizedVector = (particle2.location - particle1.location) / length;
if (damping != 0.0) {
relativeVelocity = particle1.velocity - particle2.velocity;
relativeNormalComponent = dot(relativeVelocity, normalizedVector);
force = (normalizedVector * undampenedStrength)
- (normalizedVector * damping * relativeNormalComponent);
}
else
force = normalizedVector * undampenedStrength;
Does that help out?
David Buck
Simberon Inc.
www.simberon.com
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Thank you very much. I could have been stuck on this for a while. The worst
of it is that I've seen in my various trials that my viscosity acts like
wind, but I deciced to look at this "side effect" later!
I've still some troubles, if I build a symetrical scene, the result is
getting asymetrical very fast. I guess it is due to floating point operation
precisions.
But I think that my next work is to correct the strength model: when a point
is lying on an object, it should receive a strengh from that object. It is
not done this way now, and this combine with the algorythm I've choosen to
define the new position of one point that hit an object produce wrong
behaviour.
Chaps.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
I noticed a comment on TGLTLSBFSSP (which you may have noticed is my
site of the week...) about the lack of women (or "wimmen" as we Irishmen
call them!) in raytracing. How many double-X's do we have in the
newsgroups (if any)?
--
signature{
"Grey Knight"
contact{ email "gre### [at] yahoo com" }
site_of_week{ url "http://www.esite-host.com/~rocketmg/" }
}
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |