POV-Ray : Newsgroups : povray.unofficial.patches : MegaPOV : passing spline name to macro Server Time
31 Oct 2024 21:28:12 EDT (-0400)
  MegaPOV : passing spline name to macro (Message 1 to 4 of 4)  
From: Fabien Mosen
Subject: MegaPOV : passing spline name to macro
Date: 23 Mar 2003 16:24:00
Message: <3e7e25f0$1@news.povray.org>
I have a problem.  The simple scene below works perfectly in P3.5,
but stops with an error in MegaPOV 1.0, which seems to expect
some kind of parenthesis after the spline's name.  I've read MP's
docs without result.

Fabien.

//-------------------------------------
#include "colors.inc"
#include "rand.inc"

#declare R2=seed(0);

//macro to create a random spline
#macro RandSpline (NbPoints,Taille)
  #local I = 0;
  #while (I < 1)
  #local Pt = Taille*VRand(R2);
  #local Pt = Pt+<I*200,0,0>;
   I,Pt
  #local I=I+(1/NbPoints);
  #end
#end

//macro to "draw" a line along a spline
#macro FollowSpline (Spl,NbElem,Rad1)
union {
  #local Pas = (1/NbElem);
  #local I = 0;
  #while (I < 1)
   #local Pt1 = Spl(I);
   #local Pt2 = Spl(I+Pas);
   #if (Pt1.x != Pt2.x)
    cylinder {Pt1 Pt2 Rad1*0.5}
   #end
  #local I=I+Pas;
  #end
}
#end

//creation of the random spline
#declare SplCam = spline {natural_spline RandSpline (10,30)}

//"physical" representation of that spline, this is where it stops
FollowSpline (SplCam,100,1)


Post a reply to this message

From: Martial
Subject: Re: MegaPOV : passing spline name to macro
Date: 25 Mar 2003 14:10:58
Message: <3e80a9c2@news.povray.org>


> I have a problem.  The simple scene below works perfectly in P3.5,
> but stops with an error in MegaPOV 1.0, which seems to expect
> some kind of parenthesis after the spline's name.  I've read MP's
> docs without result.

The Soluce : the keyword spline{....}

> //"physical" representation of that spline, this is where it stops
 FollowSpline (spline{SplCam},100,1)



Martial
http://Cathemline.org


Post a reply to this message

From: Fabien Mosen
Subject: Re: MegaPOV : passing spline name to macro
Date: 25 Mar 2003 14:15:58
Message: <3e80aaee$1@news.povray.org>
Martial wrote:

> The Soluce : the keyword spline{....}

Thanks a lot, Martial, you're too clever...

Fabien.


Post a reply to this message

From: ABX
Subject: Re: MegaPOV : passing spline name to macro
Date: 25 Mar 2003 14:20:06
Message: <1qa18vgf7nu330m0qvibhjtkms4mmee4q1@4ax.com>
On Tue, 25 Mar 2003 20:12:06 +0100, "Martial" <mar### [at] pov-mondeorg> wrote:
> > I have a problem.  The simple scene below works perfectly in P3.5,
> > but stops with an error in MegaPOV 1.0, which seems to expect
> > some kind of parenthesis after the spline's name.  I've read MP's
> > docs without result.
>
> The Soluce : the keyword spline{....}
>
> > //"physical" representation of that spline, this is where it stops
>  FollowSpline (spline{SplCam},100,1)

Thanks for workaround for Fabien.
Soon I find solution I will post source code fix.

ABX


Post a reply to this message

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