POV-Ray : Newsgroups : povray.general : spline settings to clock correspondence Server Time
18 Nov 2024 07:20:23 EST (-0500)
  spline settings to clock correspondence (Message 1 to 9 of 9)  
From: Dennis Miller
Subject: spline settings to clock correspondence
Date: 2 Oct 2002 18:30:18
Message: <3d9b737a@news.povray.org>
Hello. How do these settings correspond to a clock moving from 0 - 1?

spline {
    cubic_spline
    -.25, <0,0,-1>
    0.00, <3,.1,-5>
    0.25, <0,.2,-8>
    0.50, <-3,.3,-5>
    0.75, <0,-.1,0>
    1.00, <2,.2,-5>
    1.25, <0,.1,-8>
   }
Is the entire range -.25 to 1.25 compressed into the 0 - 1 range of the
clock, or are the outer two values "guide points" for the spline?
Thanks,
D.


Post a reply to this message

From: hughes, b 
Subject: Re: spline settings to clock correspondence
Date: 2 Oct 2002 20:17:56
Message: <3d9b8cb4@news.povray.org>
If it is clock 0 to 1, yes, but also the first and last points of a cubic
spline are control points so those aren't actually placed.

Linear spline would truncate to 0 to 1 too, for a clock 0 to 1 but of course
that is settable from INI file or command line to other numbers (negatives?
I haven't used clock -1 to 1 so don't know). Even though that is a "time"
value it could be a different variable instead, in which case the values are
based on that.

spline (TimeVariable)

Oops, you know what? I wanted to double-check and found that the example in
the Doc, section 6.1.9 Spline Identifiers, disallows the following change:

#declare MySpline =
  spline {
    cubic_spline
    -.5, <0,0,-1>
    -.25, <0,0,-1> // error occurs
    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>
    1.5, <0,0,1>
  }

Reason...? The negative sign of the second time value. The vectors need
commas after them to prevent an error, otherwise all is fine it seems. An
unfortunate oversight of the Doc or simply missed previously.


Post a reply to this message

From: Dennis Miller
Subject: Re: spline settings to clock correspondence
Date: 2 Oct 2002 20:38:05
Message: <3d9b916d$1@news.povray.org>
So I can assume that the values will be interpolated/scaled  to any range of
the clock;

    0.00, <3,.1,-5>
    0.25, <0,.2,-8>
    0.50, <-3,.3,-5>
    0.75, <0,-.1,0>
    1.00, <2,.2,-5>

could occur even if the clock went from .9 - 1; the relative time position
of each vector would remain the same?
d.


"hughes, b." <omn### [at] charternet> wrote in message
news:3d9b8cb4@news.povray.org...
> If it is clock 0 to 1, yes, but also the first and last points of a cubic
> spline are control points so those aren't actually placed.
>
> Linear spline would truncate to 0 to 1 too, for a clock 0 to 1 but of
course
> that is settable from INI file or command line to other numbers
(negatives?
> I haven't used clock -1 to 1 so don't know). Even though that is a "time"
> value it could be a different variable instead, in which case the values
are
> based on that.
>
> spline (TimeVariable)
>
> Oops, you know what? I wanted to double-check and found that the example
in
> the Doc, section 6.1.9 Spline Identifiers, disallows the following change:
>
> #declare MySpline =
>   spline {
>     cubic_spline
>     -.5, <0,0,-1>
>     -.25, <0,0,-1> // error occurs
>     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>
>     1.5, <0,0,1>
>   }
>
> Reason...? The negative sign of the second time value. The vectors need
> commas after them to prevent an error, otherwise all is fine it seems. An
> unfortunate oversight of the Doc or simply missed previously.
>
>


Post a reply to this message

From: hughes, b 
Subject: Re: spline settings to clock correspondence
Date: 3 Oct 2002 00:17:41
Message: <3d9bc4e5@news.povray.org>
Nope, you misunderstood. The t value is used like any other variable so
you'd get the 0.9 to 1.0 part of the spline. You are actually using any
variable number taken from elsewhere for that and when it goes out of range
of the values you use in setting up the spline it just doesn't do anything.
When the variable is within the range that's set up then it does get
applied.
For example, starting point t=0 but the clock or another variable is at -1
and increasing. When it reaches 0 it begins reacting in the spline, as long
as a t value is at 0 or above of course.

Now, this is something I'm unsure of. The interesting thing to think of here
is if cubic_spline doesn't even have a -0.25 variable to work with how does
it know to use it as a control point? I'm going to need to think this over
myself or maybe somebody in-the-know can tell us but I think the first and
last values simply remain working yet not active until the range between
those points is encountered.

I can be confusing sometimes so I sure hope I made sense.
--
Farewell,
Bob

"Dennis Miller" <dhm### [at] attbicom> wrote in message
news:3d9b916d$1@news.povray.org...
>
> could occur even if the clock went from .9 - 1; the relative time position
> of each vector would remain the same?


Post a reply to this message

From: hughes, b 
Subject: or maybe I misunderstood, sorry
Date: 3 Oct 2002 01:44:25
Message: <3d9bd939$1@news.povray.org>
Just back here rereading through and I'm thinking you might have been asking
if the vectors are still acted upon by a clock (variable) value for the
respective part of the spline instead of wondering if it runs the whole
spline.

Anyway, you probably know what I was saying. Sometimes I have to stop
thinking to figure things out.  :-)


Post a reply to this message

From: Christopher James Huff
Subject: Re: spline settings to clock correspondence
Date: 3 Oct 2002 10:12:19
Message: <chrishuff-299CAF.10091703102002@netplex.aussie.org>
In article <3d9b737a@news.povray.org>,
 "Dennis Miller" <dhm### [at] attbicom> wrote:

> Hello. How do these settings correspond to a clock moving from 0 - 1?

Well, the "clock" variable has nothing to do with it...you were unclear 
about whether you were talking about this or the input value to the 
spline.
At T = 0, the spline will return < 3, 0.1,-5>, at 1 it will return < 2, 
0.2,-5>, and so on. POV doesn't do anything to adjust the range to fit 
any other range, the 0-1 range is just a convention.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Dennis Miller
Subject: Re: spline settings to clock correspondence
Date: 3 Oct 2002 15:45:04
Message: <3d9c9e40$1@news.povray.org>
Okay, I see. My goal here is to translate the camera through the entire path
defined by the spline while the clock is moving ONLY through the range .9 to
.95. What I have done is use the Colefax autoclock macro to create a value
of 0 when the clock is at .9 and 1 when the clock reaches .95. I call this
CL:
#declare CL = (From (.9, 0) To (.95, 1)) ;

Then I use CL in the camera statement:
...
translate MySpline(CL)
...

So will the spline respond to CL and move through the entire set of points?
In other words, does CL override the real clock settings? I'm just not clear
on how the "ctr" parameter in the docs actually works.
Thanks,
D.

D.


So with this configuration, will the spline

"Christopher James Huff" <chr### [at] maccom> wrote in message
news:chr### [at] netplexaussieorg...
> In article <3d9b737a@news.povray.org>,
>  "Dennis Miller" <dhm### [at] attbicom> wrote:
>
> > Hello. How do these settings correspond to a clock moving from 0 - 1?
>
> Well, the "clock" variable has nothing to do with it...you were unclear
> about whether you were talking about this or the input value to the
> spline.
> At T = 0, the spline will return < 3, 0.1,-5>, at 1 it will return < 2,
> 0.2,-5>, and so on. POV doesn't do anything to adjust the range to fit
> any other range, the 0-1 range is just a convention.
>
> --
> Christopher James Huff <cja### [at] earthlinknet>
> http://home.earthlink.net/~cjameshuff/
> POV-Ray TAG: chr### [at] tagpovrayorg
> http://tag.povray.org/


Post a reply to this message

From: hughes, b 
Subject: Re: spline settings to clock correspondence
Date: 3 Oct 2002 17:22:12
Message: <3d9cb504@news.povray.org>
"Dennis Miller" <dhm### [at] attbicom> wrote in message
news:3d9c9e40$1@news.povray.org...
> #declare CL = (From (.9, 0) To (.95, 1)) ;
>
> translate MySpline(CL)
>
> So will the spline respond to CL and move through the entire set of
points?
> In other words, does CL override the real clock settings? I'm just not
clear
> on how the "ctr" parameter in the docs actually works.

Yes, that should do it. "ctr" is an example of whatever identifier you want
it to be. Your CL takes place of that.

What to watch out for though is that the spline is always done even if CL is
outside the range specified. In other words, unless you prevent the spline,
or thing which uses it, from being parsed and rendered it will show up as
either beginning or ending regardless of there not being a value within the
range of 't'.

You can check that by setting CL to -1 or 2 and notice that the spline still
executes with the first or last (applicable) vector. This could be a good
reason for having a spline on/off setting possible to make it easier to work
with. Then again, anything using the spline would faulter because of an
invalid parameter so maybe there isn't a way to do that. Something to think
about, or perhaps already has been.
--
Farewell,
Bob


Post a reply to this message

From: Christopher James Huff
Subject: Re: spline settings to clock correspondence
Date: 4 Oct 2002 12:15:45
Message: <chrishuff-E38FD0.12121904102002@netplex.aussie.org>
In article <3d9c9e40$1@news.povray.org>,
 "Dennis Miller" <dhm### [at] attbicom> wrote:

> So will the spline respond to CL and move through the entire set of points?

If the T values for your points go from 0 to 1. The spline parameter 
*is* the T value, if it is equal to one of the T values in the spline, 
the return value will be the vector for that T value.


> In other words, does CL override the real clock settings? I'm just not clear
> on how the "ctr" parameter in the docs actually works.

No. It doesn't have anything to do with the clock settings. The macros 
set the variable CL to a number in a certain range depending on the 
clock value. The value of clock itself is unaffected, nothing is 
overridden.
Splines have nothing to do with clock, values that depend on clock are 
just often used for the spline parameter in animations. You seem to have 
some confusion from the fact that the spline parameter indicating the 
point on the spline is often called time.

It is really very simple:
Say you have a spline which has a T value of 0.2 at point A, and 0.7 at 
point B, and no points in between. If you give the spline 0.2 as the 
input parameter, you get point A, if you give 0.7, you get point B. If 
you give 0.5, you get something in-between, what exactly you get depends 
on the type of spline. The spline points are essentially "goal points", 
they tell the spline "be here when the parameter reaches this value".
The start of the spline is the point with the lowest T value, the end is 
the point with the highest. When the parameter is equal to the lowest 
value, it will return the start, when it is the highest it will return 
the end. If it is outside that range...well, that is probably a Bad 
Thing, I don't recommend it. Nothing ever relies on a [0, 1] range, that 
is simply a convention that is used when there isn't a good reason to 
use a different range.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

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