POV-Ray : Newsgroups : povray.general : question about pov3.5 splines Server Time
20 Nov 2024 12:47:34 EST (-0500)
  question about pov3.5 splines (Message 1 to 5 of 5)  
From: sacrofts
Subject: question about pov3.5 splines
Date: 27 Sep 2001 12:53:22
Message: <3bb35982@news.povray.org>
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

From: Rune
Subject: Re: question about pov3.5 splines
Date: 30 Sep 2001 10:53:10
Message: <3bb731d6$1@news.povray.org>
"sacrofts" wrote:
> 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.

Many of the spline features in MegaPov, such as constant speed splines, have
not been implemented in POV-Ray 3.5.

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

From: sacrofts
Subject: Re: question about pov3.5 splines
Date: 1 Oct 2001 12:13:48
Message: <3bb8963c@news.povray.org>
"Rune" <run### [at] mobilixnetdk> wrote in message 
news:3bb731d6$1@news.povray.org...
> 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.
Any reasons why it was removed?

Steve


Post a reply to this message

From: Rune
Subject: Re: question about pov3.5 splines
Date: 1 Oct 2001 14:54:09
Message: <3bb8bbd1@news.povray.org>
"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

From: sacrofts
Subject: Re: question about pov3.5 splines
Date: 1 Oct 2001 18:04:35
Message: <3bb8e873@news.povray.org>
Ah, that clears up a mystery!  Thanks.
Well, I will re-write my code and wait patiently for future patches to 
start arriving :-)

Steve


Post a reply to this message

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