Télécharger le fichier arbre3d.txt et remplacer ensuite l'extention "txt" par "pov"


Arbre fractal en 3D





arbre isolé

voir en 800x600

après l'hiver ...

voir en 800x600

un bosquet

voir en 800x600


On peut voir des arbres tracés avec Maple :
Arbres 3d avec Maple

On peut trouver des arbres et autres fractales sur le site d'un collègue :
http://www.la-dimension4.com : accès à ce site

#include "colors.inc"

light_source { <6,15,-7> color rgb <0.95,0.95,1> shadowless}
light_source { <-6,15,-6> color rgb <1,1,1> }
//light_source { <-1.,1.6,-0.2>*20 color rgb <1,0.8,0>*0.4 shadowless}

background { SkyBlue*1.2 }

camera {orthographic location <0,1.5,-5>
look_at <0,0.8,0>
}

#declare sable3=texture {
pigment { granite
color_map {
[0.1 color rgb <0.7,0.5,0.5> ]
[0.5 color White*0.5 ]
} scale 0.1 }
normal {
granite 2
turbulence 0.2
scale 0.4
accuracy 1
}
finish { diffuse 0.8
ambient 0.5
}
} // fin texture

plane{ z,8 pigment {gradient y color_map {
[0.1 color rgb <0.9,0.8,0.7> ]
[0.5 color SkyBlue*0.9 ]
} scale 3.5 translate -1*y}
finish {ambient 0.65 diffuse 0.3 roughness 0.0001 }
}


plane{ y,-1
texture {
pigment { marble
color_map {
[0.2 color White*0.999 ]
[0.5 color White ]

}
turbulence 0.5
scale <1,5,1>
}
normal {
granite 0.7
accuracy 0.0001
turbulence 0.2
scale 8
}
finish {
ambient 0.5 diffuse 0.7
}
} //texture

} //plane
/*
//------------------------ arbre 1 ---------------------
#declare alea=seed(0);
#declare rap1=1;
# declare r=0.3;

#macro arbre1(n,p)
#if (n=1) cone{<0,0,0>,r/pow(p-n,rap),<0,1,0>,r/pow(p-n+1,rap)}
#else
union{ union{

#declare rap=pow(rap1,1/(n+3));
object{ arbre1(n-1,p) rotate <30,0,0> scale 0.8}
object{ arbre1(n-1,p) rotate <-50,0,-30> scale 0.75}
object{ arbre1(n-1,p) rotate <10,0,40> scale 0.65}
#declare scmax=0.9 ; // le max des 3 précédents
sphere{ 0,r/pow(p-n+1,rap)*scmax}
translate 1*y
rotate 360*rand(alea)*y }
cone{<0,0,0>,r/pow(p-n,rap),<0,1,0>,r/pow(p-n+1,rap)*scmax}
}

#end
#end
#declare p=11;
object{ arbre1(p,p+2)
texture{ sable3 scale 0.02} //pigment {rgb <0.6,0.55,0.5>}
scale 1.1
rotate 5*y
translate <0,-1,1>
}
//------------------------ fin arbre 1 ---------------------
*/


//------------------------ arbre 2 ---------------------
//plutôt que mettre de multiples paramètres à arbre1, j'ai préféré ecrire
// une autre macro
#declare alea=seed(0);
#declare rap=0.65;
# declare r=0.1;

#macro arbre2(n,p)
#if (n=1) cone{<0,0,0>,r/pow(p-n,rap),<0,1,0>,r/pow(p-n+1,rap)}
#else
union{ union{
object{ arbre2(n-1,p) rotate <-5,0,0> scale 0.9}
object{ arbre2(n-1,p) rotate <15,0,0> scale 0.6}
object{ arbre2(n-1,p) rotate <-20,0,10> scale 0.55}
object{ arbre2(n-1,p) rotate <15,0,20> scale 0.3}
#declare scmax=0.8; // le max des précédents

sphere{ 0,r/pow(p-n+1,rap)*scmax}
translate 1*y
rotate 360*rand(alea)*y } //pow(5*n,3.32)*y}// pour mettre un peu de desordre
// je n'ai pas su faire fonctionner rand
cone{<0,0,0>,r/pow(p-n,rap),<0,1,0>,r/pow(p-n+1,rap)*scmax}
}

#end
#end

#declare p=8;
#declare unarbre= object{ arbre2(p,p+2)
texture{ sable3 scale 0.02}
}
union {
object{ unarbre
scale 1. translate <0,-1,-1>}
object{ unarbre
scale 0.8
rotate 70*y translate <1,-1,0.5>}
object{ unarbre
scale 0.6 rotate 120*y translate <-1.,-1,4>}
object{ unarbre
scale 0.4 rotate 100*y translate <0.5,-1,3>}
object{ unarbre
scale 0.7 rotate 55*y translate <-0.5,-1,2.5>}

object{ unarbre
scale 0.6 rotate 160*y translate <-0.3,-2.2,2.5>}
object{ unarbre
scale 0.4 rotate 180*y translate <0.3,-2,3.2>}

scale 0.8
translate -2*z }
//------------------------ fin arbre 2 ---------------------


Début