// SHELL / Like a Turban Shell '99.04 // By Tsutomu HIGO E-mail: nj2t-hg@asahi-net.or.jp #version 3.1; global_settings { assumed_gamma 2.2 } #macro Texture_c (Cred, Cgreen, Cblue, Ctr) texture { pigment {color rgbt } finish { ambient 0.5 phong 0.3 reflection 0.2 specular 0.1 brilliance 0.5 irid {0.6 thickness 1.0 turbulence 0.2} } } #end #macro Shell_d (Ro, Nt, Ra, Rb, Na, Ho) #declare Pne = 4*Nt*Nt; #declare Rt = pi*2/(Nt-0.5); #declare Yt = 2*pi/Nt/4/Nt; #macro Ka (P) Yt*P #end #macro Rs (P) #if (cos(Rt*P)>0.7) #if (20*int(P/20)=P) #declare Prs=2; #else #declare Prs=1; #end #else #declare Prs=1; #end 0.95*Prs*Ro*pow(Ra,P)/Rb*(1+0.2*cos(P*28)*cos(P*30)) #end #macro Rl (P) 0.8*Ro*pow(Ra,P) #end #macro Hl (P) Ho*pow(Ra,P) #end #macro Triangle_units (P1,P2,P3) smooth_triangle { , , , Texture_c (0.15*cos(Rt*P1)+0.3*sin(P1/Nt)+0.15,0.6,0.3*cos(Rt*P1)+0.6*sin(P1/Nt)+0.3,0) } #end union { #declare Pn =-0; #while (Pn < Na*Pne-Nt) Triangle_units (Pn,Pn-1,Pn-Nt) Triangle_units (Pn,Pn-Nt+1,Pn-Nt) #declare Pn =Pn +1; #end } #end camera { location <0,100,500> angle 4.3//12.5 look_at <0, 0, 0> } light_source {<500, 1000, -200> color rgb <1,1,1>} light_source {<3000, 2000, 5000> color rgb <0.5,0.5,0.5>} object { Shell_d (8,18,0.9997,1.2,14,30) rotate z*180 rotate <90,0,90> translate <-18.6,0,0> } background { color rgb <0,0,0.3> }