// HOSE / Mirror '00.03 // By Tsutomu HIGO E-mail: nj2t-hg@asahi-net.or.jp #version 3.1; global_settings { assumed_gamma 2.2 } light_source {<2, 5, -5> color <0.5,0.5,0.4>} light_source {<-5, 5, 0> color <0.5,0.5,0.5>} camera { location <-5.0,-1.0,-12.0> angle 50 look_at <1.2, 0, 0> } //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 Woman(Atwistn,Atwistw, Aallx,Aally,Aallz, Pallx,Pally,Pallz, Colr,Colg,Colb) #fopen MyFile "lphsmirr.prn" read #read (MyFile, Hmax,Zmax,Rdg) //initialize the coordinates for mesh Cp(x,y,z,r) #declare Cp=array[Hmax][Zmax+2][4] #declare Cc=array[Zmax+2][3] #declare Z=0; #while (Z} finish { reflection 0 ambient 0.4 phong 0.2 brilliance 0.5 diffuse 0.5 } } rotate z*Aallz rotate y*Aally rotate x*Aallx translate no_shadow } #fclose MyFile #end union { //Woman(Atwistn,Atwistw, Aallx,Aally,Aallz, Pallx,Pally,Pallz, Colr,Colg,Colb) Woman (-20,2,0,0,-90, -20,0,0, 1,0.99,0.97) scale 0.1 } #declare Mirror= merge { box { <0, -4, -2> < 0.001, 2.5, 2> } cylinder { <0, 2.5, 0> < 0.001, 2.5, 0> 2} texture { pigment { color rgb <0.8,0.9,1>} finish { reflection 0.9 ambient -0.1 brilliance 0.5} } } union { merge { Mirror } intersection { merge { Mirror translate z*-2} box { <-1, -5, 3> < 1, 5, -2> } rotate y*19.5 translate z*-2 } intersection { merge { Mirror translate z*2} box { <-1, -5, -3> < 1, 5, 2> } rotate y*-25 translate z*2 } rotate y*-30 translate <3,0,0> }