|
|
"mmm" <mik### [at] comcastnet> wrote in message
news:web.3f7ad2c812fa09048fe3750@news.povray.org...
> Thanks for the thoughts and possible solutions. The solution by Warp and
> Tim will do nicely in my application.
Glad to hear it - it did occur to me that, under some circs., none of the
suggestions made so far (incl. mine) would work.
For a start, sphere{0,0} caused me problems when there were enough of them, so
that would seem to rule out a null object (or at least sphere{0,0} as a null).
Secondly, turning off warnings might not be ideal, since you might want to see
other warnings relating to other elements of the scene.
Finally, the suggestions from ABX and Warp only apply if you know whether you
have one object or more prior to issueing the union{ or object{.
Consider the following code:
camera {location <0,0,-80> look_at 0}
light_source {0 color rgb 1 translate <-30, 30, -30>}
#declare Rand1 = seed(235);
#macro OneOrMore() // creates between 1 and 10 spheres
#declare OCnt = int(rand(Rand1)*10)+1;
#declare C2 = 1;
#while(C2<=OCnt)
sphere{0,0.45 translate y*C2}
#declare C2=C2+1;
#end
#end
#declare C1 = 0;
#while(C1<100)
union{
OneOrMore()
translate x*(C1-50)
pigment{rgb<1,0,0>}
finish{ambient 1/4}
}
#declare C1=C1+1;
#end
Now, there is an obvious fix - move the union{ to inside the macro (and then
switch between union and object), but IMHO a more complex macro and/or scene
might make fixing it tricky....
Post a reply to this message
|
|