POV-Ray : Newsgroups : povray.newusers : can an array contain macros? : Re: can an array contain macros? Server Time
4 May 2024 09:46:59 EDT (-0400)
  Re: can an array contain macros?  
From: John Greenwood
Date: 19 Jul 2014 05:55:01
Message: <web.53ca3f5e5301cedba7cafab50@news.povray.org>
Le_Forgeron <jgr### [at] freefr> wrote:
> Le 19/07/2014 10:49, John Greenwood nous fit lire :
> > I tried this:

......
> Maybe because the "return" of the Sphere*() macro are nothing.
> The sphere get added to the scene, but I'm afraid not in the array. (as
> sphere is not an expression)
>
> As you want to store object in the array, maybe (untested) something like
> #macro Sphere1()
> #local Obj=sphere{<1,1,0>,1   pigment{rgb<1,0,0>}};
> Obj
> #end
>
> Caveat: #local vs #declare, there might be a scope issue in previous
> version of povray. (referencing a released identifier)
> --
> IQ of crossposters with FU: 100 / (number of groups)
> IQ of crossposters without FU: 100 / (1 + number of groups)
> IQ of multiposters: 100 / ( (number of groups) * (number of groups))

Thanks for the quick reply.

I am thinking this is not the way to go!

A #switch, #case structure is probably better.

John


Post a reply to this message

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