POV-Ray : Newsgroups : povray.advanced-users : Spline question (SPLINE.MCR macros) Server Time
30 Jul 2024 00:30:55 EDT (-0400)
  Spline question (SPLINE.MCR macros) (Message 1 to 3 of 3)  
From: Nicolas Calimet
Subject: Spline question (SPLINE.MCR macros)
Date: 29 Oct 2000 19:49:44
Message: <39FCC6FB.CB4DB252@free.fr>
Hi all there,

	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 ?

	Thanks !


*** Nicolas Calimet
*** http://pov4grasp.free.fr


Post a reply to this message

From: Chris Colefax
Subject: Re: Spline question (SPLINE.MCR macros)
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

From: Nicolas Calimet
Subject: Re: Spline question (SPLINE.MCR macros)
Date: 31 Oct 2000 05:20:27
Message: <39FE9E37.52EF4F48@free.fr>
Hello Chris, I hoped you actually would be the one to answer me ;-) 

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

	Okay, I forgot the 'time' dimension and focused on 2D vectors as
it was the shortest way to see my spline curve... and again I was wrong
concerning the maths behind. I'm curious to see if I could manage it using
only x coords...
 
> For this I would recommend my
> Automatic Clock Modifier macros:
>    http://www.geocities.com/ccolefax/clockmod.html

	How could I miss that one ??!! It's strange I never tried to use
this other great utility I heard about quite a long time ago... I think
it's because at that time I simply didn't tried to animate anything in
POV. I started to read the tutorial linked from your page, and sure will
use these macros ! Woah this rocks... as everything you do for us !
	Thanks Chris ! Long life to your amazing work ;-)


*** Nicolas Calimet
*** http://pov4grasp.free.fr


Post a reply to this message

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