POV-Ray : Newsgroups : povray.general : Passing macro as parameter : Re: Passing macro as parameter Server Time
20 Nov 2024 04:35:40 EST (-0500)
  Re: Passing macro as parameter  
From: Kilgore Trout
Date: 28 Oct 2001 09:09:52
Message: <3bdc11b0$1@news.povray.org>
That's sort of different from what I'm tring to do.  I'm trying to make a
macro that can make a graph of surfaces defined by Y = F(X, Z), and I want
to pass F(X, Z) as a parameter to the macro.  But not just one value of F, I
want to be able to pass the function F, so I can call it several times
inside of the macro.  If this isn't clear, then I can post my code so you
can see what I have so far and what I'm trying to get.  Right now I am
declaring F outisde of the graph macro, but this is no good because I might
want to use two different F's in one scene.

Thanks,
Kev

"JRG" <jrg### [at] hotmailcom> wrote in message
news:3bdc0e92@news.povray.org...
> First you define your two macros, then you can use one as a parameter for
> the other one:
>
> example (not tested)
>
> #macro SQUARE (A)
> A*A
> #end
>
> #macro INCR (B)
> B+1
> #end
>
> #declare c=SQUARE ( INCR (2) ); // it should give you (2+1)^2=9
>
>


Post a reply to this message

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