POV-Ray : Newsgroups : povray.advanced-users : simple for...loop question Server Time
25 Dec 2024 01:23:45 EST (-0500)
  simple for...loop question (Message 1 to 3 of 3)  
From: Eitan Tal
Subject: simple for...loop question
Date: 27 Jun 2000 18:08:10
Message: <395933C2.53F66B42@netvision.net.il>
I got y = ..........

I remember that I can go on a loop and insert numbers, but I don't
remember how
how do I do a simple for loop?

....in case I didn't use the right name, for (at least on basic) is some
statement that makes a loop
with a value that changes untill it gets equal to another value, and
then the loop ends


Post a reply to this message

From: Chris Huff
Subject: Re: simple for...loop question
Date: 27 Jun 2000 18:22:42
Message: <chrishuff-3355A4.17224327062000@news.povray.org>
In article <395933C2.53F66B42@netvision.net.il>, Eitan Tal 
<eit### [at] netvisionnetil> wrote:

> I got y = ..........
> 
> I remember that I can go on a loop and insert numbers, but I don't
> remember how
> how do I do a simple for loop?

You don't. POV currently only supports #while() loops.
You can do pretty much the same thing this way:
#declare C=0;
#while(C<NUM)

    #declare C=C+1;
#end

-- 
Christopher James Huff - Personal e-mail: chr### [at] maccom
TAG(Technical Assistance Group) e-mail: chr### [at] tagpovrayorg
Personal Web page: http://homepage.mac.com/chrishuff/
TAG Web page: http://tag.povray.org/


Post a reply to this message

From: Rune
Subject: Re: simple for...loop question
Date: 29 Jun 2000 13:09:55
Message: <395b82e3@news.povray.org>
"Eitan Tal" wrote:
> ....in case I didn't use the right name, for (at least on basic)
> is some statement that makes a loop with a value that changes
> untill it gets equal to another value, and then the loop ends

This should be what you want.
This loop is "safe" becaue it won't go on forever, even if the value cannot
be found.

#declare C = 0;
#declare Max_Loops = 1000000000;
#declare Flag = false;
#while ( Flag=false & C<Max_Loops )

   // Insert your stuff here

   #if (One_Value=Another_Value)
      #declare Flag = true;
   #end
   #declare C = C+1;
#end

Greetings,

Rune
--
Updated June 12: http://rsj.mobilixnet.dk
3D images, include files, stereograms, tutorials,
The POV Desktop Theme, The POV-Ray Logo Contest,
music, 350+ raytracing jokes, and much more!


Post a reply to this message

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