// Last edited on DATE TIME by USER
// Processed by remove-cam-lights

#include "textures.inc"

background{ color rgb < 0.75, 0.80, 0.85 > }

#declare Castelo = union {
box {< 0,0,0 > <7,7,2> texture {White_Marble}}
        union{
                cylinder {<0,0,0> <0,0,2.5>, 0.4 texture {White_Marble} }
                cone{<0,0,2.5>,0.55,<0,0,3>,0 texture{Glass2}}
                cone{<0,0,2.5>,0.4,<0,0,4>,0 texture{Glass2}}
                }
                union{
                cylinder {<7,0,0> <7,0,2.5>, 0.4 texture {White_Marble} }
                cone{<7,0,2.5>,0.55,<7,0,3>,0 texture{Glass2}}
                cone{<7,0,2.5>,0.4,<7,0,4>,0 texture{Glass2}}
                }
                union{
                cylinder {<0,7,0> <0,7,2.5>, 0.4 texture {White_Marble} }
                cone{<0,7,2.5>,0.55,<0,7,3>,0 texture{Glass2}}
                cone{<0,7,2.5>,0.4,<0,7,4>,0 texture{Glass2}}
                }
                union{
                cylinder {<7,7,0> <7,7,2.5>, 0.4 texture {White_Marble} }
                cone{<7,7,2.5>,0.55,<7,7,3>,0 texture{Glass2}}
                cone{<7,7,2.5>,0.4,<7,7,4>,0 texture{Glass2}}
                }
 }

#macro Castelos_rec (m,n,b)
        #if (m=b)
        object {Castelo scale <2*m,2*m,2>}
        Castelos_rec (m,n,b+123.123)
        #else
        object {Castelo scale <m,m,1> translate <n*1.5,n*1.5,n+2.5> }
        object {Castelo scale <m,m,1> translate <2.5*n,n*1.5,n+2.5>}

        #if (m>0.1)
                #declare n =n+n*m;
                #declare m=(m/3);
                Castelos_rec (m,n,b)
        #end
        #end
        #end

#include "eixos.inc"

object { eixos (3.00)}

Castelos_rec(1,5,1)

#include "camlight.inc"
#declare centro_cena = < 4.00, 4.00, 6.00 >;
#declare raio_cena = 20.0;
#declare dir_camera = < 7.00, -3.00, 7.00 >;
#declare dist_camera = 90.0;
#declare intens_luz = 1.00;
camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)