// MANDELBROT_FRACTAL / Whirl_Plate '00.09 // By Tsutomu HIGO E-mail: nj2t-hg@asahi-net.or.jp #version 3.1; global_settings { assumed_gamma 2.2 } light_source {<20, 50, -50> color <0.5,0.5,0.4>} light_source {<-50, 50, 0> color <0.5,0.5,0.5>} camera { location <0,-7,-10> angle 5 look_at <-0.55, -0.7, 0> } // #macro Selfsq(Rpmax,Pht, Sprit, Stre,Stim, Edre,Edim, Cnre,Cnim, Powt) #declare Dfre=(Edre-Stre)/Sprit; #declare Spriti=int((Edim-Stim)/Dfre); #declare Cp=array[Sprit+1][Spriti+1][3] #declare Dfrp=Pht*(Edre-Stre)/Rpmax; #declare Nre=0; #while (Nre4) #declare Rp=Rpmax; #else #declare Re=Pre; #declare Im=Pim; #end #declare Rp=Rp+1; #end #declare Cp[Nre][Nim][2]=pow(Rpo*Dfrp,Powt); #declare Cp[Nre][Nim][0]=Stre+Dfre*Nre; #declare Cp[Nre][Nim][1]=Stim+Dfre*Nim; #declare Nim=Nim+1; #end #declare Nre=Nre+1; #end //normal vector of (Pre,Pim) #macro Vd (Pre,Pim) <(Cp[Pre-1][Pim][1]-Cp[Pre][Pim][1]) *(Cp[Pre][Pim-1][2]-Cp[Pre][Pim+1][2])-(Cp[Pre][Pim-1][1]-Cp[Pre][Pim+1][1])*(Cp[Pre-1][Pim][2]-Cp[Pre][Pim][2]), (Cp[Pre][Pim-1][0]-Cp[Pre][Pim+1][0])*(Cp[Pre-1][Pim][2]-Cp[Pre][Pim][2]) -(Cp[Pre-1][Pim][0]-Cp[Pre][Pim][0])*(Cp[Pre][Pim-1][2]-Cp[Pre][Pim+1][2]), (Cp[Pre-1][Pim][0]-Cp[Pre][Pim][0]) *(Cp[Pre][Pim-1][1]-Cp[Pre][Pim+1][1])-(Cp[Pre][Pim-1][0]-Cp[Pre][Pim+1][0])*(Cp[Pre-1][Pim][1]-Cp[Pre][Pim][1])> #end //smooth_triangle of the surface #macro Trisd (Pre,Pim) smooth_triangle { Vd(Pre,Pim) Vd(Pre-1,Pim-1) Vd(Pre,Pim-1) } smooth_triangle { Vd(Pre-1,Pim) Vd(Pre-1,Pim-1) Vd (Pre,Pim) } #end mesh { #declare Nre=2; #while (Nre] [1 color rgb <1,1,1>] } scale 0.6 translate 0.6 } finish { reflection 0 phong 2 brilliance 1 ambient 0.7 } no_shadow rotate y*180 scale <1,1,0.5> translate <0,0,1.5> } #end Selfsq (100,1.5, 500, -0.1,-0.6, 1.3,0.8, -0.76,0.2, 0.2)