|
|
Warp <war### [at] tagpovrayorg> wrote:
> D103 <nomail@nomail> wrote:
> > #declare X1=-1.5; //in the scene file these are equal to the v_length of the
> > appropriate values.
> > #declare Z1=-1.5;
> > #declare Cnt=0;
>
> > #while(X1<=1.5)
> > #while(Z1<=1.5)
> > #if(Cnt>=15)
> > #debug "Cnt = illegal value.\n"
> > #else
> > #debug "Cnt is within legal range.\n"
> > #end
> > //#declare Pts[Cnt]=<X1, 0, Z1>;
> > sphere { 0, 0.1 pigment { White } translate <X1, 0, Z1> }
> > #declare Z1=Z1+1;
> > #declare Cnt=Cnt+1;
> > #end
> > #declare X1=X1+1;
> > #declare Z1=-1.5;
> > #end
>
> You seem to have very complicated ways of performing nested loops.
> What's wrong with the traditional way of doing nested loops? In other
> words:
>
> #declare Cnt = 0;
> #declare X1 = -1.5;
> #while(X1 <= 1.5)
> #declare Z1 = -1.5;
> #while(Z1 <= 1.5)
>
> ...
>
> #declare Z1 = Z1 + 1;
> #declare Cnt = Cnt + 1;
> #end
> #declare X1 = X1 + 1;
> #end
>
> --
> - Warp
Sorry, afraid I'm in the dark here. Perhaps you could explain in a bit more
detail? I've read the help files on nested loops, maybe there's something I
missed or misunderstood.
Thank you very much.
D103
Post a reply to this message
|
|