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:38 EDT (-0400)
  Re: Array of points for use with bicubic patch  
From: Warp
Date: 26 Apr 2011 12:22:48
Message: <4db6f158@news.povray.org>
D103 <nomail@nomail> wrote:
> #declare P1 = 1;
> #declare P2 = 1;
> #while(P1<=4&P2<=4)
    ...
>   #declare P1=P1+1;
>   #if (P1=4)
>     #declare P2=P2+1;
>     #declare P1=1;
>   #end
> #end

  That's a really complicated way of making a nested loop. What's wrong
with the regular way of doing it?

#declare P1 = 0;
#while(P1 < 4)
  #declare P2 = 0;
  #while(P2 < 4)
    ...
    #declare P2 = P2 + 1;
  #end
  #declare P1 = P1 + 1;
#end

  (Note that array indices start from 0, not from 1.)

-- 
                                                          - Warp


Post a reply to this message

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