#version 3.6;
global_settings { assumed_gamma 1.0 }
#include "colors.inc"
#include "textures.inc"
camera {location < 0 , 0 ,-8.0>
look_at < 0.0, 0.0, 0.0>}
light_source{<1800,2500,-2500> color White}
#declare Ball =
sphere {<0,0,0>,0.2
texture{pigment{color rgb<1,0.60,0.0>}
finish {ambient 0.05 diffuse 0.95 phong 1}}}
#local __number_of_spheres = 500;
#local __iter = 0;
#local __x = 0;
#local __y = 0;
#local __r = 1.0;
#local __theta = 0.0;
#local __scale = 1.0;
#local __inverse = 1;
union {
#while (__iter < __number_of_spheres)
#local __r = __r * (1.0 - (1.0 / __number_of_spheres));
#local __x = __r * cos(__theta);
#local __y = __r * sin(__theta);
#if (__inverse > 0)
#local __inverse = -1;
object{
Ball
translate <__x, __y, 0>
scale __scale * cos(__theta) * sin(__theta)
pigment{color Green}
}
#else
#local __inverse = 1;
object{
Ball
translate <__x, __y, 0>
scale __scale * cos(__theta) * sin(__theta)
pigment{color Yellow}
}
#end
#local __theta = __theta + 20.0 / __number_of_spheres;
#local __scale = __scale * (1.0 - (1.0 / __number_of_spheres));
#declare __iter = __iter + 1;
#end
scale 8
}