// POVRAY ||| COURS N¡1 06/11/2006 // BIBLIOTHEQUE #macro ma_texture( toto ) texture // matire { pigment { color rgbt toto } // couleur rŽflŽchie finish // { ambient 0.2 // rŽflexion lumire ambiante diffuse 0.7 // rŽflexion lumires incidentes specular 0.7 // rŽflexion points lumineux roughness 0.01 // rugositŽ / brillance reflection 0.1 // } } #end #macro un_tore( rayon_1, rayon_2, couleur, translation, rotation ) object { torus { rayon_1, rayon_2 } translate translation rotate rotation ma_texture( couleur ) } #end #macro multi_tores( N ) #local i=0; #while (i, <0.5,0,0>, <90, 360*i/N ,0> ) #local i=i+1; #end #end #macro anneau() difference { un_tore( 0.5, 0.2, <0,0,0,0.0>, <0,0,0>, <0,0,0> ) multi_tores( 12 ) } #end #macro chainon() anneau() object { anneau() translate <0.5,0,0> rotate <90,0,0> } #end #macro axes ( longueur ) object { cylinder { <-longueur,0,0>, , 0.01 } pigment { color rgb <1,0,0> } } object { cylinder { <0,-longueur,0>, <0,longueur,0>, 0.01 } pigment { color rgb <0,1,0> } } object { cylinder { <0,0,-longueur>, <0,0,longueur>, 0.01 } pigment { color rgb <0,0,1> } } #end #macro boite() object { box { -1/2, 1/2 } pigment { color rgbt <1,1,1,0.7> } } #end #macro cubix( N ) union { #local k=0; #while (k, 1/(2*(N-1)) } ma_texture( ) interior { ior 1.2 } } #end #local i=i+1; #end #local j=j+1; #end #local k=k+1; #end } #end // SCENE camera { location <-0.8,1,-1> look_at <0,0,0> } background { color rgb 1/2 } light_source { <-1,1,-1> color rgb <1,1,1> } light_source { <1,1,-1> color rgb <1,1,1> } light_source { <0,1,5> color rgb <1,1,1> } axes( 1 ) //chainon() //boite() cubix( 4 ) /* intersection { cubix (5) object { box { -1/2, 1/2 } pigment { color rgb <1,1,1,1.0> } rotate <-15,-15,0> } } ¬*/