POV-Ray : Newsgroups : povray.advanced-users : Adding forces to points in curves : Adding forces to points in curves Server Time
30 Jul 2024 06:30:12 EDT (-0400)
  Adding forces to points in curves  
From: Rune
Date: 27 Dec 1999 17:02:57
Message: <3867e211@news.povray.org>
Thanks to the repliers to my previous message.
I haven't found a solution yet though.
I'll try to explain my problem in greater detail:

I'm trying to make a long neck-like thing. I must be able
to set the point where the neck starts and ends. Also the
normal of the neck in these two points. ("normal" is
probably not the right word. "Vector" or "direction" is
probably better, but I'll just use "normal" here) I also
want to control the length of the neck and the number of
"links" or segments it is made of. ( The length of each
"link" would then be [length-of-neck] / [number-of-links] )

I can't just use a simple spline. To use it at all I would
first have to calculate it's length, then change the length
of the normals, that way also the length of the spline.
That I would have to do over and over again until the
length was right. Then I would have to divide the spline
into a certain number of segments of equal length. And even
then the bending of the neck wouldn't be very realistic.

Instead of that I've tried to start with a spline, but then
apply forces to each point so they will arrange correctly.

See my message in povray.binaries.scene-files
for the code I've done so far.

I have succeeded in making the points having the right
distance to each other:

A force is applied to each point. If the point is closer to
it's neighbor than the desired length then it is pushed
away from it. If the point is further away the neighbor
than the desired length then it is pulled closer to it.
This calculation is done to each sphere with each of each
sphere's two neighbors. The difference between the old
and the new position is multiplied with a small value (*1),
then stored in a temporary array. When the calculations are
done to each sphere, the changes are applied. Then it
starts all over and over again a certain number of times (*2).

This makes the point have the right distance to each other,
but nothing prevents the "neck" from bending so
unfortunately the points arrange themselves in a zig-zag
pattern.

I need help with making some forces that makes the "neck"
bend as little as possible, i.e. make the distribution of
the bending even, that way making the curve smooth.
(look in "ikn.inc" line 45.)

I hope that you understand what I'm trying to do and that
somebody might be able to help me...

Thanks,

Rune

---
Updated December 22: http://rsj.mobilixnet.dk
Containing 3D images, stereograms, tutorials,
The POV Desktop Theme, 350+ raytracing jokes,
miscellaneous other things, and a lot of fun!


Post a reply to this message

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