POV-Ray : Newsgroups : povray.advanced-users : cubic splines : Re: cubic splines Server Time
29 Jul 2024 10:25:20 EDT (-0400)
  Re: cubic splines  
From: Christopher Johnson
Date: 17 May 2002 11:13:05
Message: <3ce51e01@news.povray.org>
It's not really an analytical solution.  You pass a spline to the macro and
it creates a reference spline.  The reference spline is based on the error
between time and distance.

Say you had your spline .. S
And the resulting reference spline .. K

if you wanted a point that was 75% of the length of the spline

K(0.75).x would give you the time value T
S(T) would be the point at 75% of the length.

This method would make more sense for motion curves as opposed to
dynamically create splines for ... whatever.  The idea is that instead of
having to compute an estimation on the fly like Colefax's macro, this one is
more of a preprocessor.  You run it once.  Save the reference it creates.
Then the only computation needed for a distance is the call to the reference
macro.  I still need to clean up a few routines but the debug version was
tested with a mean error of 0.0004 off actual distance( I'll have better
numbers soon) .  It works pretty well, I just have to optimize a few of the
unsavory hacked portions.

I'll post the code when I get it cleaned up, hopefully in a couple days.



news:vb79euo1cl533eesphr95n2i5lqmkc55v4@4ax.com...
> On Thu, 16 May 2002 19:11:49 -0400, "Christopher Johnson"
> <age### [at] hotmailcom> wrote:
> > I've been working on a macro to preprocess cubic splines so that you can
> > specify a specific distance along the spline as opposed to just a
function
> > of time.
>
> How you do it ? I have it already done for spline tutorial I'm working on
but
> perhaps could be interesting to compare methods. Have you analitical
solution?
> I have general solution for all types of splines, not only cubic.
>
> ABX


Post a reply to this message

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