// HEAVE / Heaving waves at night '03.05 // By Tsutomu HIGO E-mail: nj2t-hg@asahi-net.or.jp #version 3.1; global_settings { max_trace_level 5 assumed_gamma 2.2 } camera { location <-100, 250, -400> angle 30 look_at <800, -200, 400> } light_source {<50000, -3000, 50000> color rgb <0.8, 1, 0.8>} #macro Wave (Xo, Yo, Zo, To, Lo) #declare Yo = 40*sin(1.5*To/pi+pi*0.8+0.3*pi*Lo)/(0.3+0.1*To)*sin(0.2*Lo+0.02*To); #declare Xo = 10*To+20*cos(1.5*To/pi+pi*1)/(0.3+0.1*To)-1*Yo; #declare Zo = 100*(Lo-2); #declare Lxz = sqrt(Xo*Xo*4+Zo*Zo); #declare Yo = Yo-Lxz*sin(asin(Lo/2/150)); #end //***************** Mesh treatment ***************** //triangle of the surface #macro Trid (Ph,Pv) #declare Phs1 = Ph-1; triangle { } triangle { } #end //normal vector of the point #macro Vd (Ph,Pv) <(Cp[Ph-1][Pv][1]-Cp[Ph][Pv][1])*(Cp[Ph][Pv-1][2]-Cp[Ph][Pv][2]) -(Cp[Ph][Pv-1][1]-Cp[Ph][Pv][1])*(Cp[Ph-1][Pv][2]-Cp[Ph][Pv][2]), (Cp[Ph][Pv-1][0]-Cp[Ph][Pv][0])*(Cp[Ph-1][Pv][2]-Cp[Ph][Pv][2]) -(Cp[Ph-1][Pv][0]-Cp[Ph][Pv][0])*(Cp[Ph][Pv-1][2]-Cp[Ph][Pv][2]), (Cp[Ph-1][Pv][0]-Cp[Ph][Pv][0])*(Cp[Ph][Pv-1][1]-Cp[Ph][Pv][1]) -(Cp[Ph][Pv-1][0]-Cp[Ph][Pv][0])*(Cp[Ph-1][Pv][1]-Cp[Ph][Pv][1])> #end //smooth_triangle of the surface #macro Trisd (Ph,Pv) #declare Blue = texture { pigment {color rgbt <1, 1, 1, 0>} finish {reflection 0.6 ambient 0.2 phong 1 diffuse 0.5 brilliance 1} normal {ripples 1 rotate y*0 scale 100 frequency 15 translate <10000, 1000, 30>} } smooth_triangle { Vd(Ph,Pv) Vd(Ph-1,Pv-1) Vd(Ph,Pv-1) texture {Blue} } smooth_triangle { Vd(Ph-1,Pv) Vd(Ph-1,Pv-1) Vd(Ph,Pv) texture {Blue} } #end #declare Ncase = -1; #declare Tmax = 150; #declare Lmax = 150; #declare Cp = array[Tmax][Lmax][3] #declare T = 0; #while (T rotate z*-10 rotate y*-15 no_shadow} #declare L = L+1; #end #declare T = T+1; #end sky_sphere { pigment { gradient y color_map { [0.0 color rgb <0.3, 0.6, 1>] [1.0 color rgb <0, 0.05, 0.1>] } } }