// MANDELBROT_FRACTAL / 3 Directions Mandelbrot Mountain '00.09 // By Tsutomu HIGO E-mail: nj2t-hg@asahi-net.or.jp #version 3.1; global_settings { assumed_gamma 2.2 } light_source {<-1, 6, -10> color <1,0.5,1>} camera { location <0,3,-10> angle 28 look_at <0, 0, 0> } // #macro Mandelbrot3 (Rpmax,Pht, Sprit, Stre,Stim, Edre,Edim, 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 (Nre12) #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] [0.97 color rgb <0.8,0.8,1>] [1 color rgb <0.2,0.2,0.3>] } scale 0.55 translate 0.66 } finish { reflection 0 phong 2 brilliance 1 ambient 0.7 } scale <2,2,6> no_shadow rotate x*-90 rotate y*230 translate <0,-6.6,1.4> } #end Mandelbrot3 (120,1.5, 400, -2.8,-2.2, 1.5,2.2, 0.1) // (20,1.5, 40, -2.8,-2.2, 1.5,2.2, 0.1) fog{ color rgb <0.7,0.7,1> fog_type 2 fog_alt 0.35 fog_offset -0.5 distance 2 }