|
|
Jason Dinger <jas### [at] hotmailcom> wrote:
: #declare ct = 0;
: #while (ct<10)
: blob { threshold .5
: sphere {0,1,1 translate ct*y}
: pigment {rgb <1,0,0>} }
: #declare ct = ct + .5;
: #end
Think about it. Each time the #while-loop is parsed, a copy of all that is
between the #while and the #end is created.
So the first time this is created:
blob { threshold .5
sphere {0,1,1 translate ct*y}
pigment {rgb <1,0,0>} }
#declare ct = ct + .5;
Now we loop again and we get another copy:
blob { threshold .5
sphere {0,1,1 translate ct*y}
pigment {rgb <1,0,0>} }
#declare ct = ct + .5;
blob { threshold .5
sphere {0,1,1 translate ct*y}
pigment {rgb <1,0,0>} }
#declare ct = ct + .5;
and so on. When we loop 10 times we get 10 (independent) blob statements.
Obviously you don't want 10 separated blob statements, but one single
blob statement with 10 spheres inside it. Thus we have to create the
blob statement just once:
blob { threshold .5
#declare ct = 0;
#while (ct<10)
sphere {0,1,1 translate ct*y}
#declare ct = ct + .5;
#end
pigment {rgb <1,0,0>}
}
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
|