// HOSE / Dolphin '00.03 // By Tsutomu HIGO E-mail: nj2t-hg@asahi-net.or.jp #version 3.1; global_settings { max_trace_level 3 assumed_gamma 2.2 } light_source {<20000, 100000, -50000> color <0.8,0.8,1>} camera { location <0,0,-100> angle 56 look_at <0, 15, 0> } #declare Rdg=10; //radius of arranging sphere //initialize the coordinates for mesh Cp(x,y,z,r) #declare Zmax=60; #declare Hmax=36; #declare Cp=array[Hmax][Zmax+2][4] #declare Cc=array[Zmax+2][3] #declare Z=0; #while (Z } triangle { } #end //normal vector of the plar coordinates point #macro Vd (Ph,Pv) <(Cp[mod(Ph-1+Hmax,Hmax)][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[mod(Ph-1+Hmax,Hmax)][Pv][2]-Cp[Ph][Pv][2]), (Cp[Ph][Pv-1][0]-Cp[Ph][Pv][0])*(Cp[mod(Ph-1+Hmax,Hmax)][Pv][2]-Cp[Ph][Pv][2])-(Cp[mod(Ph-1+Hmax,Hmax)][Pv][0]-Cp[Ph][Pv][0])*(Cp[Ph][Pv-1][2]-Cp[Ph][Pv][2]), (Cp[mod(Ph-1+Hmax,Hmax)][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[mod(Ph-1+Hmax,Hmax)][Pv][1]-Cp[Ph][Pv][1])> #end //smooth_triangle of the surface #macro Trisd (Ph,Pv) #declare Ph1=mod(Ph-1+Hmax,Hmax); smooth_triangle { Vd(Ph,Pv) Vd(Ph1,Pv-1) Vd(Ph,Pv-1) } smooth_triangle { Vd(Ph1,Pv) Vd(Ph1,Pv-1) Vd (Ph,Pv) } #end #macro Vrect (P) #if (Cc[P][2]-Cc[P-1][2]=0) #declare Cc[P-1][2]=Cc[P-1][2]-0.000001; #end #declare Vvx=Cc[P][0]-Cc[P-1][0]; #declare Vvy=Cc[P][1]-Cc[P-1][1]; #declare Vvz=Cc[P][2]-Cc[P-1][2]; #declare Vvl=sqrt(Vvx*Vvx+Vvy*Vvy+Vvz*Vvz)+0.000001; #declare Vvx=Vvx/Vvl; #declare Vvy=Vvy/Vvl; #declare Vvz=Vvz/Vvl; #declare Vxz=(Cc[P-1][0]-Cc[P][0])/(Cc[P][2]-Cc[P-1][2]); #declare Vxl=sqrt(1+Vxz*Vxz); #declare Vxx=1/Vxl; #declare Vxy=0; #declare Vxz=Vxz/Vxl; #declare Vyz=-(Cc[P][1]-Cc[P-1][1])*(Cc[P][2]-Cc[P-1][2])/(pow(Cc[P][0]-Cc[P-1][0],2)+pow(Cc[P][2]-Cc[P-1][2],2)); #declare Vyx=Vyz*(Cc[P][0]-Cc[P-1][0])/(Cc[P][2]-Cc[P-1][2]); #declare Vyl=sqrt(Vyx*Vyx+1+Vyz*Vyz); #declare Vyx=Vyx/Vyl; #declare Vyy=1/Vyl; #declare Vyz=Vyz/Vyl; #if (Cc[P][2]-Cc[P-1][2]<0) #declare Vxx=-Vxx; #declare Vxz=-Vxz; #end #if (Cc[P][2]-Cc[P-1][2]=0) #declare Cc[P-1][2]=Cc[P-1][2]+0.000001; #end #end #macro Dolphin(Atwist, Aallx,Aally,Aallz, Pallx,Pally,Pallz, Vallys,Vallyc,Vallyd,Vallz) #declare Z=0; #while (Z0.1) #declare Ahd=pow((Z-Zmax*0.1)/(Z+Zmax-Zmax*0.1),0.05)*pi/2; #declare Ah=pi/2-(Z/Zmax-0.1)*pi; #if (abs(Ah-2*pi*H/Hmax)} finish { reflection 1 ambient 0.3 phong 1 brilliance 1 diffuse 1 } normal { bumps 0.5 scale 20 } } rotate translate } #end //Dolphin(Atwist, Aallx,Aally,Aallz, Pallx,Pally,Pallz, Vallys,Vallyc,Vallyd,Vallz) Dolphin (-20,-30,150,0, 5,0,0, 0.5,1.2,pi/2,1) Dolphin (-40,15,230,24, 33,28,50, 5,0.5,0,-1) Dolphin (20,-25,180,5, 10,23,100, 1.8,0,-pi*0.3,0) //background {color rgbt <0.0,0.8,0.5>} fog { fog_type 1 distance 200 color rgb <0,0.5,0.8> }