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 14:16:24 EDT (-0400)
  Re: Array of points for use with bicubic patch  
From: Warp
Date: 3 May 2011 11:20:04
Message: <4dc01d24@news.povray.org>
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


Post a reply to this message

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