POV-Ray : Newsgroups : povray.binaries.images : Cloth experiment : Re: Cloth experiment Server Time
19 Nov 2024 15:48:28 EST (-0500)
  Re: Cloth experiment  
From: David Buck
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

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