POV-Ray : Newsgroups : povray.text.tutorials : #while loop nesting? Server Time
16 Apr 2024 15:59:04 EDT (-0400)
  #while loop nesting? (Message 1 to 4 of 4)  
From: Phil Clute
Subject: #while loop nesting?
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

From: Phil Clute
Subject: Re: #while loop nesting?
Date: 18 Aug 1999 15:44:34
Message: <37BB0DD3.D11C2526@tiac.net>
I knew I'd figure it out once I posted! Oh well, let this be a lesson to
those who've never nested #while loops before...

#declare Y = 120;
#declare Z = -35.7;
#declare OL= 0;
#declare RY = 0;
#while(OL < 2) 
    #declare i = 0; // The i = 0 must be allowed to reinitialise
    #while(i < 16)  //INSIDE the outer loop...     
    	difference{ ...etc.
-- 
...coffee?...yes please! extra sugar,extra cream...Thank you.


Post a reply to this message

From: Philip Bartol
Subject: Re: #while loop nesting?
Date: 21 Aug 1999 03:43:56
Message: <37be58bc@news.povray.org>
In article <37BB0DD3.D11C2526@tiac.net>, Phil Clute <pcl### [at] tiacnet> wrote:
>....coffee?...yes please! extra sugar,extra cream...Thank you.

You're not using Arachne are you?

PHIL

---------------------------------------------------


Post a reply to this message

From: Phil Clute
Subject: Re: #while loop nesting?
Date: 22 Aug 1999 02:18:23
Message: <37BF96E9.5E25824B@tiac.net>
Phil Bartol wrote:
>You're not using Arachne are you?

I really just shouldn't post when I'm half asleep...

Phil
-- 
...coffee?...yes please! extra sugar,extra cream...Thank you.


Post a reply to this message

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