POV-Ray : Newsgroups : povray.general : Spline identifiers Server Time
4 Aug 2024 12:17:13 EDT (-0400)
  Spline identifiers (Message 1 to 10 of 10)  
From: LibraryMan
Subject: Spline identifiers
Date: 27 May 2003 17:25:01
Message: <web.3ed3d715461a4cd9738e706a0@news.povray.org>
In the section of the docs about spline identifiers (6.1.9), what is the
significance of the reference numbers (i.e., the float values that are in
increments of 0.25) in the example below:
#declare MySpline =
  spline {
    cubic_spline
    -.25, <0,0,-1>
    0.00, <1,0,0>
    0.25, <0,0,1>
    0.50, <-1,0,0>
    0.75, <0,0,-1>
    1.00, <1,0,0>
    1.25, <0,0,1>
  }

then in the section 6.1.9.1, they give this example:
#declare myspline = spline {
      1, <4,5>
      3, <5,5>
      5, <6,5>
  }

  Foo(myspline, 2)

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?
TIA,
LibraryMan


Post a reply to this message

From: Hughes, B 
Subject: Re: Spline identifiers
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

From: LibraryMan
Subject: Re: Spline identifiers
Date: 28 May 2003 11:45:02
Message: <web.3ed4d89fa160507a738e706a0@news.povray.org>
Hughes, B. wrote:

>
>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.

>Bob H.
>

Well, if it had been specified from the outset that the example spline
identifier was to be used in an animation, that may have helped clarify
matters a bit.  I was *suspecting* the 0.25-incremented values had
something to do with animation clocking, but it didn't say so, and I
haven't ventured into animation just yet, so I wouldn't have necessarily
recognized the difference.

I suppose I *am* being dense about what the -0.25 and 1.25 values have to do
with control points of a cubic_spline; I mean, the 3-D vectors are already
specified, and the spline type could be changed to sommething else and
POVRay should know what to do in whichever case...


Post a reply to this message

From: ingo
Subject: Re: Spline identifiers
Date: 28 May 2003 12:35:11
Message: <Xns9389BD98AF830seed7@povray.org>
in news:web.3ed4d89fa160507a738e706a0@news.povray.org LibraryMan wrote:

> I suppose I *am* being dense about what the -0.25 and 1.25 values
> have to do with control points of a cubic_spline; I mean, the 3-D
> vectors are already specified, and the spline type could be changed
> to sommething else and POVRay should know what to do in whichever
> case... 
> 

For a better understanding why more points are needed for a cubic spline 
read section "6.5.1.7  Lathe" of the documention.

Ingo


Post a reply to this message

From: Hughes, B 
Subject: Re: Spline identifiers
Date: 28 May 2003 12:35:58
Message: <3ed4e56e@news.povray.org>
"LibraryMan" <mrm### [at] attnet> wrote in message
news:web.3ed4d89fa160507a738e706a0@news.povray.org...
>
> Well, if it had been specified from the outset that the example spline
> identifier was to be used in an animation, that may have helped clarify
> matters a bit.

That's only one way to think of it though, was what I was saying. The first
example is using #while loop, second is animation, third is macro. So
splines are very versatile, many ways to use it.

> I suppose I *am* being dense about what the -0.25 and 1.25 values have to
do
> with control points of a cubic_spline; I mean, the 3-D vectors are already
> specified, and the spline type could be changed to something else and
> POVRay should know what to do in whichever case...

Having reread that section of the doc myself I can see how it could confuse
people. Lots of things can, in fact. Not always easy to understand until
applying what you learn and practicing, to truly know it.

The Note paragraph is a good thing to see there in section 6.1.9 since that
sums up the reasons for the "t" value (-0.25 to 1.25, for example) and how
it relates to spline type or out of range values for "t". You might ask what
would be out of range... If you had a while loop carrying the t value
from -10 to +10 and your spline contains just 0 to 1 then obviously it will
still only use the 0 through 1 points (vectors). Not expanding it to -10 to
+10 but instead awaiting the valid numbers to be introduced before getting a
change in the spline. It repeats point 0 until reached, doing same for 1
after that is surpassed.

That said, it sure might be a nice feature addition if that could be
switched on and off. That way invalid points could be skipped and not
repeated uselessly if unneeded.

Bob H.


Post a reply to this message

From: LibraryMan
Subject: Re: Spline identifiers
Date: 28 May 2003 15:00:02
Message: <web.3ed505aba160507a738e706a0@news.povray.org>
Hughes, B. wrote:
 Not always easy to understand until
>applying what you learn and practicing, to truly know it.
>
Darn, I was gonna' try printing out this whole thread and sleeping with it
under my pillow for maximum absorption... ;-)
Thanks for your responses-- I will try and work with the doc examples to
figure out what's going on.  Just about every new thing I try in POV
necessitates this stage.  Animations and isosurfaces are farther yet down
the road for me...
--Mark


Post a reply to this message

From: LibraryMan
Subject: Re: Spline identifiers
Date: 29 May 2003 14:40:01
Message: <web.3ed652f8a160507a738e706a0@news.povray.org>
ingo wrote:

>
>For a better understanding why more points are needed for a cubic spline
>read section "6.5.1.7  Lathe" of the documention.
>
>
I *do* understand why control points are needed, but I'd expect they had to
be expressed as vectors.  The incremented float values in the example don't
seem to *be* expressing vectors, hence my confusion.  I thought vectors had
to be enclosed by '< >'.


Post a reply to this message

From: LibraryMan
Subject: Re: Spline identifiers
Date: 29 May 2003 16:15:01
Message: <web.3ed6693ca160507a738e706a0@news.povray.org>
LibraryMan wrote:
>In the section of the docs about spline identifiers (6.1.9), what is the
>significance of the reference numbers (i.e., the float values that are in
>increments of 0.25) in the example below:
>#declare MySpline =
>  spline {
>    cubic_spline
>    -.25, <0,0,-1>
>    0.00, <1,0,0>
>    0.25, <0,0,1>
>    0.50, <-1,0,0>
>    0.75, <0,0,-1>
>    1.00, <1,0,0>
>    1.25, <0,0,1>
>  }
>
>then in the section 6.1.9.1, they give this example:
>#declare myspline = spline {
>      1, <4,5>
>      3, <5,5>
>      5, <6,5>
>  }
>
>  Foo(myspline, 2)
>
>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?
>TIA,
>LibraryMan
>


Now I finally get it; the reference value was being used by the counter in
the macro -- it helps to look at the WHOLE example! Duhhh... ;-)


Post a reply to this message

From: Hughes, B 
Subject: Re: Spline identifiers
Date: 29 May 2003 20:02:27
Message: <3ed69f93@news.povray.org>
"LibraryMan" <mrm### [at] attnet> wrote in message
news:web.3ed652f8a160507a738e706a0@news.povray.org...
> ingo wrote:
> >
> >For a better understanding why more points are needed for a cubic spline
> >read section "6.5.1.7  Lathe" of the documention.
> >
> I *do* understand why control points are needed, but I'd expect they had
to
> be expressed as vectors.  The incremented float values in the example
don't
> seem to *be* expressing vectors, hence my confusion.  I thought vectors
had
> to be enclosed by '< >'.

Um, okay, here goes another of my explanations: Vectors ARE vectors  ;)
such as <1,2>, <1,2,3>, <1,2,3,4> and <1,2,3,4,5>; which are the possible
kind POV-Ray uses. Seems you have gotten lost about the meaning of that t
value used in splines. They are similar to the color_map index values that
are used to place a (color) vector, but in the case of spline you might
think of them as determining placement of the associated vectors as a
function of time or number sequence. In the spline, control points are both
float and vector together. Other things that use cubic_spline, like lathe,
aren't using a time or sequence float to space the points out. The lathe
gets its spacing from the y part of the vector, I guess that might be a good
way of saying it, since it typically is thought of as being drawn along the
y axis.

Bob H.


Post a reply to this message

From: LibraryMan
Subject: Re: Spline identifiers
Date: 30 May 2003 11:20:01
Message: <web.3ed77679a160507a738e706a0@news.povray.org>
Hughes, B. wrote:
>"LibraryMan" <mrm### [at] attnet> wrote in message
>news:web.3ed652f8a160507a738e706a0[at]news.povray.org...
>> ingo wrote:
>> >
>> >For a better understanding why more points are needed for a cubic spline
>> >read section "6.5.1.7  Lathe" of the documention.
>> >
>> I *do* understand why control points are needed, but I'd expect they had
>to
>> be expressed as vectors.  The incremented float values in the example
>don't
>> seem to *be* expressing vectors, hence my confusion.  I thought vectors
>had
>> to be enclosed by '< >'.
>
>Um, okay, here goes another of my explanations: Vectors ARE vectors  ;)
>such as <1,2>, <1,2,3>, <1,2,3,4> and <1,2,3,4,5>; which are the possible
>kind POV-Ray uses. Seems you have gotten lost about the meaning of that t
>value used in splines. They are similar to the color_map index values that
>are used to place a (color) vector, but in the case of spline you might
>think of them as determining placement of the associated vectors as a
>function of time or number sequence. In the spline, control points are both
>float and vector together. Other things that use cubic_spline, like lathe,
>aren't using a time or sequence float to space the points out. The lathe
>gets its spacing from the y part of the vector, I guess that might be a good
>way of saying it, since it typically is thought of as being drawn along the
>y axis.
>
>Bob H.
>

Thanks, I think I'm finally "on the right page" now.  I appreciate your
efforts!
--MMW


Post a reply to this message

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