POV-Ray : Newsgroups : povray.general : Help with IDENTIFIER and MACRO needed. Server Time
7 Aug 2024 07:16:28 EDT (-0400)
  Help with IDENTIFIER and MACRO needed. (Message 1 to 5 of 5)  
From: Andrew Cocker
Subject: Help with IDENTIFIER and MACRO needed.
Date: 15 Nov 2001 18:38:16
Message: <3bf451e8@news.povray.org>
Hi,

I've come across a problem that I don't know how to resolve. If I set up a
spline
eg.

#declare MySpline=
spline {
linear_spline
0, <0,0,0>
1, <1,1,1>
}

 why is it that the following doesn't work, and is there a workaround?

#declare SplinePoint=MySpline(clock); //Gives error

Also (this may be the same problem in a different guise), why does the
following not work, and is there a workaround for this too?

#macro MyMacro (Point1, Point2, Num)
#local New=Point2-Point1+Num;
#end

MyMacro (MySpline(clock),<3,3,3>,6) //Gives error

Thanks in advance,

Andy Cocker


Post a reply to this message

From: Mark Wagner
Subject: Re: Help with IDENTIFIER and MACRO needed.
Date: 16 Nov 2001 00:37:47
Message: <3bf4a62b@news.povray.org>
Andrew Cocker wrote in message <3bf451e8@news.povray.org>...
> why is it that the following doesn't work, and is there a workaround?
>
>#declare SplinePoint=MySpline(clock); //Gives error


It doesn't work because POV-Ray sees the "MySpline", decides that you are
declaring "SplinePoint" as a spline, and gets confused when it finds "("
rather than ";" or "{".  The workaround is:

#declare SplinePoint=<0,0,0>+MySpline(clock);

This tells POV-Ray that you are declaring SplinePoint as a vector.

>Also (this may be the same problem in a different guise), why does the
>following not work, and is there a workaround for this too?
>
>#macro MyMacro (Point1, Point2, Num)
>#local New=Point2-Point1+Num;
>#end
>
>MyMacro (MySpline(clock),<3,3,3>,6) //Gives error


I think it's the same problem.  I could be more certain if you had posted
the error message.

--
Mark


Post a reply to this message

From: Andrew Cocker
Subject: Re: Help with IDENTIFIER and MACRO needed.
Date: 16 Nov 2001 07:00:05
Message: <3bf4ffc5@news.povray.org>
"Mark Wagner" <mar### [at] gtenet> wrote in message
news:3bf4a62b@news.povray.org...

> I think it's the same problem.  I could be more certain if you had posted
> the error message.

Thanks Mark. Will see if that fixes the second problem. If not, will post
error message.

All the best,

Andy Cocker


Post a reply to this message

From: Ron Parker
Subject: Re: Help with IDENTIFIER and MACRO needed.
Date: 16 Nov 2001 08:04:41
Message: <slrn9va3na.f46.ron.parker@fwi.com>
On Fri, 16 Nov 2001 00:38:16 -0500, Mark Wagner wrote:
> It doesn't work because POV-Ray sees the "MySpline", decides that you are
> declaring "SplinePoint" as a spline, and gets confused when it finds "("
> rather than ";" or "{".  The workaround is:
> 
> #declare SplinePoint=<0,0,0>+MySpline(clock);

Can't you also #declare SplinePoint=(MySpline(clock)); ?


-- 
#macro R(L P)sphere{L F}cylinder{L P F}#end#macro P(V)merge{R(z+a z)R(-z a-z)R(a
-z-z-z a+z)torus{1F clipped_by{plane{a 0}}}translate V}#end#macro Z(a F T)merge{
P(z+a)P(z-a)R(-z-z-x a)pigment{rgbt 1}hollow interior{media{emission T}}finish{
reflection.1}}#end Z(-x-x.2y)Z(-x-x.4x)camera{location z*-10rotate x*90}


Post a reply to this message

From: Warp
Subject: Re: Help with IDENTIFIER and MACRO needed.
Date: 16 Nov 2001 09:29:52
Message: <3bf522df@news.povray.org>
Ron Parker <ron### [at] povrayorg> wrote:
: Can't you also #declare SplinePoint=(MySpline(clock)); ?

  And make it look more like Lisp? H*** no! ;)

-- 
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

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