// HEAVE / Looking up heaving waves '03.05 // By Tsutomu HIGO E-mail: nj2t-hg@asahi-net.or.jp #version 3.5; global_settings { max_trace_level 3 assumed_gamma 2.2 } camera { location <-100, -300, -160> angle 80 look_at <0, -28, 0> } light_source {<600, -800, 500> 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; #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.1, 0.7, 0.6>} finish {reflection 0.4 ambient 0.3 phong 1 diffuse 0.5 brilliance 1} normal {ripples 1 rotate y*0 scale 100 frequency 15 translate z*500} } 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 = 60; #declare Lmax = 50; #declare Cp = array[Tmax][Lmax][3] #declare T = 0; #while (T] [1.0 color rgb <0,0,0.3>] } } }