|
|
I ran into some confusion as to how #init_spline works. I was bothered
for a while that it can give values far outside the range of data
points. But know I understand what's going on and there's no 'bug.'
I offer this demonstration just so you can know what to expect. I set up
an #init_spline and a linear spline with the same data points.
___________________________________________________
#version unofficial MegaPov 0.4
#include "colors.inc"
#init_spline {"Lshininit",
<0.00, -15>,
<0.25, -125>,
<0.45, -110>,
<0.50, -10>,
<0.75, -25>,
<1.00, -15>
}
#declare Lshinlinear=spline{
linear_spline
0.00, -15,
0.25, -125,
0.45, -110,
0.50, -10,
0.75, -25,
1.00, -15
}
#declare nn=0
#while(nn<1)
sphere {<(nn+0.0025)*300,Lshinlinear(nn+0.0025).y,0>,2
pigment{Red}
finish{ambient 1}
}
sphere {<nn*300,eval_spline ("Lshininit",nn),0>,2
pigment{Green}
finish{ambient 1}
}
#declare nn=nn+.005;
#end
camera
{
location <100, 0.5, -400>
look_at <100, 0.0, 0.0>
}
Post a reply to this message
Attachments:
Download 'splinebroke.jpg' (10 KB)
Preview of image 'splinebroke.jpg'
|
|