POV-Ray : Newsgroups : povray.text.tutorials : #while loop nesting? : #while loop nesting? Server Time
29 Apr 2024 15:23:51 EDT (-0400)
  #while loop nesting?  
From: Phil Clute
Date: 18 Aug 1999 15:25:17
Message: <37BB094C.DC7D2AE@tiac.net>
I can't seem to figure out why my outer loop won't execute. The
inner-loop
works fine, but I'm expecting the outer-loop to kick in and bump up Y +
24
to translate the differenced sphere upward and make the next set of
cuts.
I feel certain I'm making a silly mistake(like maybe pov can't have
nested
#while loops...I think I've done that before?).

#declare Y = 120;
#declare Z = -35.7;
#declare OL = 0;
#declare i = 0;
#declare RY = 0;
#while(OL < 2)            
	#while(i < 16)        
       	difference{                
        	sphere{<0,0,0>, 10 scale <0.75,1,1>}        
                plane{y,-7}
                scale 1.2 
               	translate <0,Y,Z>
                rotate <0,RY,0>
       	}
        #declare RY = RY + 22.5;
        #declare i = i + 1;  
        #end              
#declare OL = OL + 1;            
#declare Y = Y + 24;
#end  
-- 
...coffee?...yes please! extra sugar,extra cream...Thank you.


Post a reply to this message

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