POV-Ray : Newsgroups : povray.advanced-users : Spring-Algorithm : Re: Spring-Algorithm Server Time
29 Jul 2024 08:14:40 EDT (-0400)
  Re: Spring-Algorithm  
From: Christoph Hormann
Date: 6 Sep 2002 12:29:57
Message: <3D78D805.165C42FC@gmx.de>
Tim Nikias wrote:
> 
> I've been trying to implement Hugo Elias' Springs
> for cloth in order to create some strings (to finally
> script some hair), but the algorithm somehow does
> not work.

IIRC clothray is based on this description so you can be sure it works. 
Having a look at the clothray source might help.

> AFAIK some have already implemented the algorithm,
> so if anyone could give me their code for me to look at
> (Only the spring one, everything else need not be bothered
> about), I'd be grateful...

A (linear) spring is really simple, the force is proportional to the
extension from the standard length.  In 3D:

#declare Dist=Pos_End-Pos_Start;
#declare Force=vnormalize(Dist)*(vlength(Dist)-Zero_Length)*c_spring;


Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 13 Aug. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

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