/* #macro M(u,v) #end #macro dMu(u,v) #end #macro dMv(u,v) <-sin(u)*cos(u)*sin(v), sin(u)*cos(u)*cos(v), sin(u)^2*cos(v)^2-sin(u)^2*sin(v)^2> #end S := x^2*y^2+x^2*z^2+y^2*z^2-x*y*z #macro Cer1(u) <-(1/2)*(cos(u)+(-3*cos(u)^2+2)^(1/2))*cos(u), (1/2)*(-cos(u)+(-3*cos(u)^2+2)^(1/2))*cos(u), cos(u)^2-1/2> #end #macro C1(t) <-(1/2)*(t+(-3*t^2+2)^(1/2))*t, (1/2)*(-t+(-3*t^2+2)^(1/2))*t, t^2-1/2> #end #declare suiteP = <0,0,0,0,1,0,0,1,0,0,0,0,0,0,-1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0>; */ #version 3.7; global_settings { assumed_gamma 2.2 } #include "colors.inc" #include "metals.inc" #include "stones.inc" #include "transforms.inc" #include "glass.inc" camera { orthographic location <-0,8,-20> look_at<0,0.2,0> angle 10 right 1*x } // rotate 2*y } // light_source { <-20,30,-50> White } light_source { <10,40,-100> color White*0.8 shadowless} light_source { <4,-40,-20>*10 color rgb <1,0,0>*1.4 shadowless} //Aquamarine background{ White* 0.8} // Black } // //------------------------------------------- // axes ---------------------- #declare axes= union{ #local g=1.8 ; #local r1=0.025; #local k=4;// longueur fleche=k*r1 #local co=1.8;// rayon base=co*r1 union{ cylinder{ 0,,r1 } cone{ ,co*r1,,0 } pigment { Red } } //transmit 0.3 union{ cylinder{ 0,<0,g,0>,r1 } cone{ <0,g,0>,co*r1,<0,g+k*r1,0>,0 } pigment { Green } } union{ cylinder{<0,0,0>,<0,0,g>,r1 } cone{ <0,0,g>,co*r1,<0,0,g+k*r1>,0 } pigment {Blue } } }; //----------- texture acier ---------------- #declare T_Acier = texture { T_Glass3 pigment {rgb <0.,0.8,1>*1. transmit 0.2 } // pigment { Aquamarine*0.8 transmit 0.3 } // Blue*0.5 transmit 0.3 } // // Coral*0.5 transmit 0.3 } // color <1,1,1>*0.4 } // pigment { color <0.35,0.4,0.4>*0.6 } finish { ambient 0.1 reflection 0.15 roughness 0.0002 diffuse 0.6 phong 0.6 phong_size 45.0 } }; #declare monfinish=finish{ ambient 0.1 diffuse 0.5 reflection 0.1 roughness 0.01 phong 0.6 phong_size 10}; #macro tex(col,tr) texture{ pigment{col transmit tr} finish{monfinish} } #end //------------- INITIALISATION cas 3 --------------------- #declare tt=1; #macro droites() array[4] {<-2.41*tt,tt,1>,<-.41*tt,tt,1>,<.41*tt,tt,1>,<2.41*tt,tt,1>} #end // pour k=-2 // k=-1 ----> {<0,tt,0>,<0,tt,1>} #end // ,<0,tt+1,0>,<0,tt+1,1> //-------------- la surface ------------------------- #declare surf= poly{4, <0,0,0,0,1,0,0,1,0,0,0,0,0,0,-1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0>}; #macro Cer1(uu) < -(1/2)*( cos(uu)+sqrt(-3*cos(uu)*cos(uu)+2) )*cos(uu), (1/2)*(-cos(uu)+sqrt(-3*cos(uu)*cos(uu)+2))*cos(uu), cos(uu)*cos(uu)-1/2> #end // #macro C1(tt) <-(1/2)*(tt+sqrt(-3*tt*tt+2))*t, (1/2)*(-t+sqrt(-3*tt*tt+2))*t, t^2-1/2> #end #declare u0=acos(sqrt(6)/3); #declare r=0.005; #declare gr_Cer1= union{ #local n=300; #local pas= (pi-2*u0)/n; #for(i,0,n-1) cylinder{Cer1(u0+i*pas),Cer1(u0+(i+1)*pas),r } sphere{Cer1(u0+i*pas),r} #end }; //################### Surface avec points et normales sans tableaux ############# //################### avec calcul mathématique des normales ############# #macro pt(uu,vv) #end #macro dpu(uu,vv) #end #macro dpv(uu,vv) <-sin(uu)*cos(uu)*sin(vv), sin(uu)*cos(uu)*cos(vv), sin(uu)*sin(uu)*cos(vv)*cos(vv)-sin(uu)*sin(uu)*sin(vv)*sin(vv)> #end #macro surf_math(umin,umax,vmin,vmax,uiter,viter) #local pasu = (umax-umin)/uiter ; #local pasv = (vmax-vmin)/viter; union{ // methode math #local uu = umin; #for(m,0,uiter-1) //boucle externe #local uu = umin+m*pasu; #for(n,0,viter-1) #local vv = vmin+n*pasv; #local p1=pt(uu,vv); #local n1=vcross(dpu(uu,vv),dpv(uu,vv)); #local p2=pt(uu+pasu,vv); #local n2=vcross(dpu(uu+pasu,vv),dpv(uu+pasu,vv)); #local p3=pt(uu+pasu,vv+pasv); #local n3=vcross(dpu(uu+pasu,vv+pasv),dpv(uu+pasu,vv+pasv)); #local p4=pt(uu,vv+pasv); #local n4=vcross(dpu(uu,vv+pasv),dpv(uu,vv+pasv)); //TRIANGLES object{ smooth_triangle{ p1,n1, p2,n2, p3,n3 } } object{ smooth_triangle{ p1, n1, p3, n3 p4, n4 } } #end // fin boucle interne #end //fin boucle externe } #end // surf_math #declare bandesUcste= union{ #declare n=15; #declare pasU=pi/n/4; #for(i,0,n-1) surf_math(2*i*pasU,(2*i+1)*pasU,0,2*pi,50,200) #end }; //============================================================================================================= #declare tab=array[7] { <0, 0, 1/2>, <1/2, 0, 0>, <0, 1/2, 0>,<0, 0, -1/2>, <-1/2, 0, 0>, <0, -1/2, 0> ,<0,0,0>}; //--------------------------------------------------- union{ object{ surf texture{T_Acier} } // object{ bandesUcste texture{T_Acier} } object{ gr_Cer1 tex(Red,0) } object{ gr_Cer1 tex(Red,0) rotate 180*z } object{ gr_Cer1 tex(Red,0) matrix<1,0,0 ,0,-1,0 ,0,0,-1, 0,0,0> } object{ gr_Cer1 tex(Red,0) matrix<-1,0,0 ,0,1,0 ,0,0,-1, 0,0,0> } cylinder{<-1/2,0,0>, <1/2,0,0>,r/2 tex(Yellow,0)} cylinder{<0,-1/2,0>, <0,1/2,0>,r/2 tex(Yellow,0)} cylinder{<0,0,-1/2>, <0,0,1/2>,r/2 tex(Yellow,0)} #for(i,0,6) sphere{tab[i],r*1.5 tex (Blue,0) } #end scale 3.4 rotate <35,-20,-13> // rotate -10*z translate <-0.0,.2,0> } //----------------------------------------- text { ttf "times.ttf" "AE" 0.3,0 pigment {White*0.6} scale 0.09 rotate <-5,5,0> translate <1.2,-0.7,-1.2>*1.4 // *1.4 finish{ ambient 0.2 diffuse 0.3} }