POV-Ray : Newsgroups : povray.general : Explanation of recursive macros. : Re: Explanation of recursive macros. Server Time
8 Aug 2024 22:09:07 EDT (-0400)
  Re: Explanation of recursive macros.  
From: BigCeef
Date: 12 Sep 2000 17:55:49
Message: <39bea665@news.povray.org>
Hi Gilles,

I'm mid-way through another render at the moment, so I can't try this out,
but I'm encouraged by the fact that I think I understand what's going on in
the code.

Thanks for your prompt help,

Andy Cocker

"Gilles Tran" <tra### [at] inapginrafr> wrote in message
news:39BE87B6.90917B5C@inapg.inra.fr...
> Explaining I don't know, but the code below is as simple as possible so it
may
> be self-explanatory (I hope).
> #version 3.1
> camera{location  -z*4  direction 1.5*z  right     4/3*x  look_at  0}
> light_source{<-1,1,-1>*100 rgb 1}
> #macro Recurs(L)
> union{
> #if (L>0)
>     #local M=L-1;
>     cylinder{0,y,0.1}
>     object{Recurs(M) rotate z*45 translate y}
>     object{Recurs(M) rotate -z*45 translate y}
> #end
> }
> #end
> object{Recurs(4) scale 0.5 translate -y pigment{rgb x}}
>
> G.
>


Post a reply to this message

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