POV-Ray : Newsgroups : povray.general : Spline identifiers : Re: Spline identifiers Server Time
5 Nov 2024 07:20:39 EST (-0500)
  Re: Spline identifiers  
From: Hughes, B 
Date: 27 May 2003 18:36:06
Message: <3ed3e856@news.povray.org>
"LibraryMan" <mrm### [at] attnet> wrote in message
news:web.3ed3d715461a4cd9738e706a0@news.povray.org...
>
> I guess what I'm asking is, what is the significance of the reference
> numbers (if that's what they are) being 0.25 apart, vs. being odd numbers?
> It further confuses me that in the Foo macro, a `2' is thrown in as a
> parameter, which I don't see in the spline identifier declaration....
> What's up with this?

The documentation is showing you a macro for getting both a spline and a
value from it. The numbers 1, 3 and 5 are the reference numbers along a
linear spline (default, since none was specified) going from 1 to 5.
foo(Bar,2) means get the value of y from at point 2 along that spline. That
may be confusing you, but once you understand the macro is extracting that
point you probably realize what it means now.

So... think of 0 to 1 being a range used for the default clock in
animations, or for simplicity's sake. The -0.25 and 1.25 are there for the
control points needed by cubic_spline (less than 0 and greater than 1 not
included in the spline for end result). However, any incremental values can
be used, not just the usual "clock" range. 0 to 255 for example, to be used
in color_map, etc., and then divided by 255 to get 0 to 1 again. Any value
should be okay, within reason I suppose.

Gee, now that I think over that particular macro I see that it would always
return a value of 5 for the variable Y. Using something like 1,2,3 instead
of 5,5,5 could be more informative since the macro then gives a 1.5, being
halfway between the iterations 1 and 3.

Hopefully I explained this well enough, in the way I do.

Bob H.


Post a reply to this message

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