// TUBE / Wisper from Mouth '99.02 // 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 ) texture { pigment { color rgb } finish { ambient 0.5 phong 3 reflection 0.8 specular 1.8 brilliance 1 } } #end #macro Smooth_coil (Ro, Nt, Dr, Zr, Zn) //(4, 6, 0.2, 4, 5) #declare Pne = 4*Nt*Nt; #declare Dt = Dr/Nt; #declare Rt = pi*2/(Nt-0.5); #declare Yt = 2*pi/Nt/4/Nt; #declare Zc = Zr/Pne; #macro Triangle_units (P1,P2,P3) smooth_triangle { , , , , , Texture_c ( 1,0.4+0.4*sin(Rt*P1),0 ) } #end union { #declare Pn =0; #while (Pn < Zn*Pne) Triangle_units (Pn,Pn-1,Pn-Nt) Triangle_units (Pn,Pn-Nt+1,Pn-Nt) #declare Pn =Pn +1; #end } #end camera { location <-80,50,0> angle 6.5 look_at <0, 0, 0> } light_source {<500, 1000, -200> color rgb <1,1,1>} #declare Nt = 6; object { Smooth_coil (2, 32, 0.2, 4, 1.0) //(Ro, Nt, Dr, Zr, Zn) scale 1.2 rotate <0,120,0> translate <0,0.4,0> } background { color rgb <0.3,0,0> }