POV-Ray : Newsgroups : povray.general : #while loops and staggered offsets ? : Re: #while loops and staggered offsets ? Server Time
16 Nov 2024 01:18:23 EST (-0500)
  Re: #while loops and staggered offsets ?  
From: Ron Parker
Date: 4 Nov 1998 17:06:01
Message: <3640cfc9.0@news.povray.org>
On Wed, 04 Nov 1998 13:49:09 -0800, Ken <tyl### [at] pacbellnet> wrote:
>How would I create the same sort of grid where evey other
>row in the z direction is offset by 0.5 in the x direction.
>My intention is easying the pain of placing shingles on a
>roof where it is important that the cracks of overlapping
>rows do not line up while back filling the spaces that would
>be left by doing so.

//I switched your loops around so you won't have as many calculations.

#declare x2 =  0;
#declare z1 =  0;
#while  (z1 < 10)
  #declare x1 =  0;
  #while  (x1 < 10)
    object{Obj translate <x1+x2,0,z1>}
    #declare x1 = x1 + 1;
  #end
  #declare x2 = 0.5 - x2;
  #declare z1 = z1 + 1;
#end


Post a reply to this message

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