POV-Ray : Newsgroups : povray.general : Array of points for use with bicubic patch : Re: Array of points for use with bicubic patch Server Time
29 Jul 2024 20:18:51 EDT (-0400)
  Re: Array of points for use with bicubic patch  
From: D103
Date: 5 May 2011 09:05:00
Message: <web.4dc2a00d2d1676e45ae2687f0@news.povray.org>
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

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