POV-Ray : Newsgroups : povray.binaries.images : Cloth experiment Server Time
16 Aug 2024 22:13:25 EDT (-0400)
  Cloth experiment (Message 1 to 10 of 12)  
Goto Latest 10 Messages Next 2 Messages >>>
From: Chaps
Subject: Cloth experiment
Date: 29 Nov 2001 12:09:37
Message: <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...).

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


 

From: gilrain
Subject: Re: Cloth experiment
Date: 29 Nov 2001 16:23:20
Message: <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

From: David Buck
Subject: Re: Cloth experiment
Date: 29 Nov 2001 19:08:36
Message: <3C06CE5D.688A59B@simberon.com>
> 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

From:
Subject: Re: Cloth experiment
Date: 29 Nov 2001 20:45:51
Message: <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

From: Chaps
Subject: Re: Cloth experiment
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

From: Chaps
Subject: Re: Cloth experiment
Date: 30 Nov 2001 10:02:36
Message: <3c079f8c$1@news.povray.org>
Thank you for the answer,
I already look at this site, and find many useful ideas.

Chaps

"gilrain" <joh### [at] murraystateedu> 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

From: Chaps
Subject: Re: Cloth experiment
Date: 30 Nov 2001 10:03:45
Message: <3c079fd1$1@news.povray.org>
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

From: David Buck
Subject: Re: Cloth experiment
Date: 30 Nov 2001 22:38:12
Message: <3C0850FD.7B636C88@simberon.com>
Chaps wrote:
> 
> "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:
> <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

From: Chaps
Subject: Re: Cloth experiment
Date: 3 Dec 2001 05:58:34
Message: <3c0b5ada$1@news.povray.org>
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

From: s1631001
Subject: Re: Cloth experiment
Date: 3 Dec 2001 06:48:50
Message: <3C0B66C1.AD2EA443@namtar.qub.ac.uk>
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] yahoocom" }
  site_of_week{ url "http://www.esite-host.com/~rocketmg/" }
}


Post a reply to this message

Goto Latest 10 Messages Next 2 Messages >>>

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