// HEAVE / Heaving waves in the daylight '03.05 // By Tsutomu HIGO E-mail: nj2t-hg@asahi-net.or.jp #version 3.5; global_settings { max_trace_level 5 assumed_gamma 2.2 } camera { location <-120, 100, -360> angle 82 look_at <0, -60, 0> } light_source {<1600, 2000, 1500> color rgb <1, 1, 1>} #macro Wave (Xo, Yo, Zo, To, Lo) #declare Xo = 50*Lo+5*sin(5*Lo/pi/4)-1000; #declare Yo = (15*sin(3*To/pi+pi*1.5)+12*cos(5*Lo/pi/3))/(0.3+0.1*To)+50; #declare Zo = 30*To+5*cos(3*To/pi+pi*1.5)+8*sin(5*Lo/pi/2)-0.5*Yo-300; #declare Lxz = sqrt(Xo*Xo+Zo*Zo); #declare Yo = Yo-Lxz*sin(asin(Lo/2/5000)); #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 rgb <0.2, 0.7, 0.5>} finish {reflection 0.7 ambient 0.1 phong 1 diffuse 0.5 brilliance 1} normal {ripples 1 rotate y*0 scale 70 frequency 15 translate <-300, 0, 1000>} } 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 Tmax = 70; #declare Lmax = 70; #declare Cp = array[Tmax][Lmax][3] #declare T = 0; #while (T] [1.0 color rgb <0, 0.3, 0.8>] } } }