POV-Ray : Newsgroups : povray.general : while () { while () {}} doesn't work propertly. : while () { while () {}} doesn't work propertly. Server Time
7 Aug 2024 13:16:45 EDT (-0400)
  while () { while () {}} doesn't work propertly.  
From: Eitan Tal
Date: 25 Sep 2001 16:21:31
Message: <3BB0E68B.B75F68DB@netvision.net.il>
It looks like it ignores the first while.
Take a look at this:
#declare cRed=0
#declare cGreen=0

#while (cRed < 1)
    #while (cGreen < 1)
        sphere {<cRed*2.5,cGreen*2.5, 0>, 0.2 pigment {color rgb <cRed,
cGreen, 0>}}
        #declare cGreen=cGreen+0.1
    #end
    #declare cRed=cRed+0.1
#end

It only makes 10 objects (this is what written in Messages)
and cRed always = 0. it looks like it only supports one #while.

possible (and easy) to do a workaround using mod (modulo, % in c++)
possible (but annoying) to do with a switch. do I have to use the
switch? or maybe it was fixed in a newer version? I'm running here
#version 3.1

BTW: I don't like the ; semicolon after #declare. it seems so wrong for
me, because it is a #directive that goes to the compiler. on C++, it
will Not have ; semicolon.


Post a reply to this message

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