POV-Ray : Newsgroups : povray.advanced-users : Spline question (SPLINE.MCR macros) : Re: Spline question (SPLINE.MCR macros) Server Time
29 Jul 2024 22:29:10 EDT (-0400)
  Re: Spline question (SPLINE.MCR macros)  
From: Chris Colefax
Date: 30 Oct 2000 17:01:49
Message: <39fdefcd@news.povray.org>
Nicolas Calimet <pov### [at] freefr> wrote:
> I've been playing with the nice Chris Colefax's macros for
> a while now, but I encountered a problem I cannot solve since I'm
> stupid in mathematics - or maybe blind when reading docs.
> I wanna define a clock function based on a spline shape.
> The spline is in 2D (x/y plane) in order to get y = f(x) with x
> being the current clock value in the animation. The macros allow
> to get the x,y coordinates for either a clock value along the
> spline (spline_value; evaluate_spline with spline_clock option)
> or a spline fraction (even_spline_value - btw, docs says it's
> "spline_even_value", which is wrong). In any case it means you
> get the coordinates depending on the spline length.
> My problem is: how to get the y coordinate for a particular
> x value ? I don't see any macro for that, and can't deal too much
> with the internal maths in the code... Any help ?

A spline that uses XYZ co-ordinates is actually four dimensional, with the
spline time as the extra dimension.  Similarly, creating a flat spline
actually gives a function with three dimensions.  What you want is a
two-dimensional function, which you *could* create using a one-dimensional
spline (e.g. specify spline points with only x co-ords).

I would imagine, however, that what you really want is to specify a list of
clock times and the target values you want at each time, with a function
that interpolates between each value.  For this I would recommend my
Automatic Clock Modifier macros:

   http://www.geocities.com/ccolefax/clockmod.html

It allows you to create timelines for values using a simple syntax, and in
addition to single float values you can interpolate/keyframe between
vectors, colours, pigments, textures, densities, and other map values.  You
can also specify various transition types for between each keyframe value,
such as accelerate/decelerate, wave, oscillation, recoil, and more.


Post a reply to this message

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