POV-Ray : Newsgroups : povray.general : Hair-Modelling using Springs? : Re: Hair-Modelling using Springs? Server Time
5 Aug 2024 14:11:38 EDT (-0400)
  Re: Hair-Modelling using Springs?  
From: Tim Nikias
Date: 5 Sep 2002 00:29:04
Message: <3d76dd90@news.povray.org>
About the springs:

If I only use springs to move nodes apart, they may
stretch and stretch and the distance between two of
them get too long.
That's why I needed the formulae for springs which will
tie two nodes together, using more force the more they're
apart.

About IK:
I know that my approach is kinda freaky, but my latest
algorithm made use of electrostatic repulsion (see some
recent animations in binaries), it was rather fast and needed
only few iterations to come to a stable state.
Using this method I wanted to tie nodes together to get a
hair, and then use the same repulsion system to avoid
intersections.

But I'll think about IK, though I'm not too happy with
the idea of dropping my first thought, I'd rather at least
try it if its worthwhile for at least some bunch of hairs...

Thanks for your detailed answer though!

Tim

--
Tim Nikias
Homepage: http://www.digitaltwilight.de/no_lights/index.html
Email: Tim### [at] gmxde


> Tim,
>
> no intend to sound discouraging, but making a physical model of hair
> is a massive endeavor! If you can rent the DVD of Final Fantasy : The
> Movie, I think there are some figures that show how really slow this
> thing.
>
> The problem is not simulating a single hair itself, this is more or
> less trivial (well, doing it *efficiently* falls beyond the scope of
> trivial :) )
>
> The real problem is to simulate the interaction between several dozen
> thousand hairs. Whatever shortcuts you take - bounding octree
> optimizations, penalty functions, implicit integration and so on, you
> end up with a *lot* of collision tests.
>
> Well, for the case of a couple hundred hairs, this is not so drastic,
> but still the basic unoptimized approach is a O(n*n) complexity one.
> Add to that the segments that each hair is broken into and you get the
> picture...
>
> Now, to the point. I think you'd better leave any thoughts of springs
> for the moment. The equations are just too stiff. Although hair is
> somewhat elastic on tension, you'd better treat it as rigid. That is,
> made of rigid segments joined with ball-socket joints. This brings the
> problem down to simple IK with constraints or even better, penalties,
> and this one is already not that hard to solve, CPU-time-wise.
>
> I also suggest you separate the IK model from that that will be used
> for rendering. By this I mean that you can go with a much lower
> precision for the IK than that you will need for rendering. For
> example, a hair can easily be simulated with 10 segments, but when you
> render them, you can pass a spline through the joints and make them
> 1000, or use a sphere sweep. Using that precision for calculation is
> pointless.
>
> I will assume you have a basic idea how to implement simple IK, if
> not, there are many tutorials on Ken's links that you can follow. I
> recommend Hugo Elias' page. The model there sacrifices on physical
> accuracy, but is really simple and really simply explained.
>
> The next thing you would want to add are penalty functions. Think of
> them as repulsion forces pushing the hair away from the sphere, the
> plane and itself so that it doesn't intersect. Not much of a force,
> rather a concept, because in pure IK forces are not really used.
> Anyway, the penalty functions you will want to use will be based on
> distance. Distance from a sphere is trivial, from a plane almost as
> easy and as for a segment in 3D space, I can't tell you the exact
> formula off the top of my head, but it's right there in the POV source
> code - more precisely, in the blob cylinder component code.
>
> Well, I guess not really the answer you expected, but I hope I gave
> you enough hints to get you started :)
>
> >Nontheless, I also need springs which pull nodes back
> >together, as to keep a certain length for the hair.
>
> This one I don't understand. Can you please clarify?
>
>
> Peter Popov ICQ : 15002700
> Personal e-mail : pet### [at] vipbg
> TAG      e-mail : pet### [at] tagpovrayorg


Post a reply to this message

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