POV-Ray : Newsgroups : povray.general : #while loops and staggered offsets ? : Re: #while loops and staggered offsets ? Server Time
13 Aug 2024 03:21:46 EDT (-0400)
  Re: #while loops and staggered offsets ?  
From: Margus Ramst
Date: 5 Nov 1998 02:18:56
Message: <3641514E.3E5A0B81@peak.edu.ee>
x1 goes from 0 to 10 each row, that's why you get this effect when using it for
Y position. Try this:

#declare Obj = box{-1,1 scale<.9,.2,1.5>pigment{rgb 1}}
 
#declare x2 =  0;
#declare y1 =  0;
#declare z1 =  0;
#while  (z1 < 10)
	#declare x1 =  0;
	#while  (x1 < 10)
	object{Obj translate <x1+x2,y1,z1>}
	#declare x1 = x1 + 1;
#end
#declare x2 = 0.5 - x;
#declare y1 = y1 + .2
#declare z1 = z1 + 1;
#end


Post a reply to this message

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