POV-Ray : Newsgroups : povray.advanced-users : subtle behavior of Spline_Trans() macro in transforms.inc : Re: subtle behavior of Spline_Trans() macro in transforms.inc Server Time
3 Jul 2024 04:49:06 EDT (-0400)
  Re: subtle behavior of Spline_Trans() macro in transforms.inc  
From: clipka
Date: 19 Apr 2009 21:20:00
Message: <web.49ebcc72987a083f1a1b9caf0@news.povray.org>
"Kenneth" <kdw### [at] earthlinknet> wrote:
> How these things may affect the Matrix, Transform and VProject_Plane stuff there
> is beyond me; but Foresight=0 obviously isn't a good recipe for success.
> IMHO--and in an ideal world-- the code should be rewritten to be more elegant
> and 'all-inclusive,' so to speak--so that a value of zero IS exact alignment.

It's fundamentally impossible to do that.

Are you familiar with calculus?

Exact alignment would mean that the current direction would be the tangent to
the spline at the current position.

To compute a tangent to an arbitrary curve defined as f(t) (the value of which
in this case is a vector), you need the derivative f'(t) of that function,
which is defined as:

    f'(t) = lim(d->0) [f(t+d)-f(t)]/d

which is to say, take two *infinitesimally* close points on the function, and
divide the difference between the function values by the difference between the
function parameters.

As you will see, although this is an exact mathematical definition, it doesn't
work with d = 0 because you'd get 0/0, which is nonsense.

Of course even POV-SDL macros cannot overcome fundamental mathematical
limitations.


The only alternative would be to figure out a general formula for f'(t) for the
spline type and parameters in question - but as there is no way to query either
of these from SDL, we're stuck with what the macro does.


Post a reply to this message

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