POV-Ray : Newsgroups : povray.unofficial.patches : POV+for() : Re: POV+for() Server Time
2 Sep 2024 22:15:05 EDT (-0400)
  Re: POV+for()  
From: Phil Clute
Date: 6 May 1999 03:18:23
Message: <373135A1.478CBBF6@tiac.net>
>...oh, I forgot the name... but anyway, it would allow
>things like this:
>
>Instead of
>
>#declare i=i+1;
>
>we could have
>
>#declare i++;

The ++ is called the increment operator.
The -- is called the decrement operator.

I don't see a burning need for these since they just add or subtract
one from the variable.
There may be a use for *= and other compound operators, but still the
long version of what these accomplish gets the job done.

Regarding the for() loop, I usually just use this as an incrementing
loop anyhow which can be accomplished with the while loop by adding
an incrementer at the end. ie:

(I pulled this out of one of my objects)

#declare GX = 0;
#declare GR = 0;
#while (GX < 20)
union{
        cylinder {<0,.065,0>,
                  <0,0.03,0>,
                  0.01475
        }
        superellipsoid{ <.1,.1>
                scale<.0007,.0175,.017>
                rotate y*GR
                translate<0,.0475,0>
}
        texture{Chrome}
}
#declare GX = GX + 1;
#declare GR = GR + 18;
#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.