|
|
Hello,
Can anyone help?
I was just figuring out how splines worked in megapov when 3.5 beta1 was
released. I've included some code below using megapov splines. What I
was trying to do was form the shape of a bench using a spline and then
place a piece of bench at each point that the spline was evaluated.
In megapov, all I needed were the positions within the spline and
megapov would go ahead and evaluate it placing each piece of bench
evenly along the spline. But for pov 3.5 I seem to need to know the
'fraction' along the spline for each point's spline parameter in order
to get this even distribution.
I could estimate the parameter value for each position in the spline,
but that seems a little messy given the power that pov can achieve. Is
there a way around this, or something glaringly wrong in my
understanding of the new syntax :-)
Sorry if this is totally the wrong group for this question.
Steve
/*---megapov 0.7 code */
#init_3d_spline {"BenchSpline", <0,0,0>,<10,5,0>,<20,0,0>,
<25,-15,0>,<35,-50,0>,<40,-60,0>,
<51,-60.5,0>,<86,-55,0>,<95,-60,0>,
<102,-75,0>,<100,-80,0>
}
#declare UnitBench =
union {
box {<-0.5,0.25,-0.1>,<0.5,-0.25,0.1>}
cylinder {<-0.5,0.25,0>,<0.5,0.25,0>,0.1}
cylinder {<-0.5,-0.25,0>,<0.5,-0.25,0>,0.1}
}
#declare Bench =
union {
#local cnt = 0;
#while (cnt < 1)
#local OldPos = eval_3d_spline ("BenchSpline", cnt -
1/1000000);
#local NowPos = eval_3d_spline ("BenchSpline", cnt);
#local Norm = 90 + degrees(atan2 (NowPos.y - OldPos.y ,
NowPos.x - OldPos.x));
object {UnitBench scale <1,5,5> rotate <0,90,Norm> translate
NowPos }
#local cnt = cnt + 1/35;
#end
pigment {red 1}
}
Post a reply to this message
|
|
|
|
"sacrofts" wrote:
> "Rune" wrote:
> > Many of the spline features in MegaPov, such as constant
> > speed splines, have not been implemented in POV-Ray 3.5.
>
> That's a shame, as it was a very useful feature in megapov.
I agree.
> Any reasons why it was removed?
As I recall it it was something like this:
The splines in MegaPov contained many bugs and the constant speed splines
were only available in the spline syntax that was not supported in POV-Ray
3.5. The splines in POV-Ray 3.5 are more or less rewritten from scratch.
They were actually planned not to be included at all, but at a very late
stage it was decided to include them anyway. There was not time to get all
the extra features in though, and there are still obvious bugs in the
implementation.
The spline feature really is far from complete, at least according to one
Team members who didn't speak officially for the team, but it was decided to
include it anyway, though as an experimental feature.
Rune
--
3D images and anims, include files, tutorials and more:
Rune's World: http://rsj.mobilixnet.dk (updated June 26)
POV-Ray Users: http://rsj.mobilixnet.dk/povrayusers/
POV-Ray Webring: http://webring.povray.co.uk
Post a reply to this message
|
|