![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
I'd like to be able to convert a MegaPOV "3d_spline" (without T values)
into a P3.5 spline, with T values, while keeping the "constant time"
(equality of intervals) along the spline.
Does anyone knows about a #macro that would do that ?
Fabien.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
in news:3D6### [at] skynet be Fabien Mosen wrote:
> Does anyone knows about a #macro that would do that ?
>
>
Fabien,
I'm not sure if this is what you're looking for, as I've never used "the
other" spline type in MegaPov.
The maco takes an array of points as input, it always expects one point
before the start of the spline and one point beyond the end of it. The
t-value will go from ...,0 - 1,...
SplType is a string to set the wanted type of spline (C/c/L/l/N/n/Q/q).
---%<------%<---
#macro BuildSpline(Arr, SplType)
#local Ds=dimension_size(Arr,1);
#local Asc=asc(strupr(SplType));
#if(Asc!=67 & Asc!=76 & Asc!=81)
#local Asc=76;
#debug "\nWrong spline type defined (C/c/L/l/N/n/Q/q), using
default linear_spline\n"
#end
spline {
#switch (Asc)
#case (67) //C cubic_spline
cubic_spline
#break
#case (76) //L linear_spline
linear_spline
#break
#case (78) //N linear_spline
natural_spline
#break
#case (81) //Q Quadratic_spline
quadratic_spline
#break
#end
#local Add=1/((Ds-2)-1);
#local J=0-Add;
#local I=0;
#while (I<Ds)
J
Arr[I]
#local I=I+1;
#local J=J+Add;
#end
}
#end
---%<------%<---
Ingo
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
> Fabien,
> I'm not sure if this is what you're looking for, as I've never used "the
> other" spline type in MegaPov.
Thanks, but it doesn't work as I would want. Well, I finally, I've
written a specific #macro to place things at regular intervals along
an ordinary P3.5 spline. Basically, it measures the length of the
spline by discrete integration, then runs along the spline and places an
object each time a given distance has been 'travelled'. I'll
clean it and publish it here.
Fabien.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |