POV-Ray : Newsgroups : povray.general : Math problem : Re: Math problem Server Time
12 Aug 2024 07:20:57 EDT (-0400)
  Re: Math problem  
From: Andrew Cocker
Date: 13 Mar 1999 13:56:59
Message: <36eab4fb.0@news.povray.org>
Thanks for that Jerry, although at this stage, it seems incomprehensible. You'll
perhaps
understand why when I tell you that, as yet, I have never even created an array, let
alone
manipulated one. I'll start from scratch, and ask more questions later when ( not *if*
) I
get really stuck.

If you have any further suggestions that might help me make progress, they'd be most
welcome.

Thanks again


-----------
Andy


Jerry Anning wrote in message <36e98aea.22674829@news.povray.org>...
>On Fri, 12 Mar 1999 20:32:52 -0000, "Andrew Cocker"
><and### [at] acockerfreeservecouk> wrote:
>
>>I want to try out arrays. My plan is to create a cube made up of, say, 20x20x20 tiny
>>spheres. If I pick one of these spheres and designate it to be the centre of the
effect
>>I'm trying to create, and scale it by a factor of 2, how do I make the surrounding
spheres
>>get gradually smaller until 5 spheres away they are back to scale 1? I plan to
animate
the
>>effect so that the centre of the effect moves around inside the array of spheres.
>
>Give this little macro the array coordinates of the sphere you are
>defining and of the sphere at the center of the effect. At the proper
>point in the sphere definition say:
>
>scale Size(Mysphrx, Mysphry, Mysphrz, Mycentx, Mycenty, Mycentz)
>
>#macro Size(_Xloc, _Yloc, _Zloc, _Cxloc, _Cyloc, _Czloc)
>  #local _Dist = min(min(abs(_Xloc - _Cxloc), abs(_Yloc -_Cyloc)),
>                                 abs(_Zloc - _Czloc));
>  #local _Scl = (5 - max(_Dist, 5)) / 5;
>  <_Scl, _Scl, _Scl>
>#end
>
>The macro will, of course, work with actual position coordinates as
>well and for noninteger positions (with a Manhattan metric).  To do
>this for another range, replace every occurrence of 5 with a variable
>and add that variable to the parameter list.  This reduces the size
>linearly.  If you want to do inverse square or somesuch, or change the
>metric, it is pretty simple.  You can also easily modify it to wrap
>around.
>
>Jerry Anning
>clem "at" dhol "dot" com


Post a reply to this message

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