#version unofficial MegaPov 0.4; #include "colors.inc" global_settings { assumed_gamma 1.0 max_trace_level 100 } background { color rgb (2+<1/15,1/sqrt(15),1>)*0.15 } // Light constants. #declare lightDir = vnormalize(<-0.5,2.1,-2>); #declare lightLen = 1.5e3; #declare lightCol = <1,.97,.95>; // Camera constants. #declare camPos = -30*z; #declare camLookAt = <0,0,0>; #declare camAngle = 30; camera { up <0, 1, 0> right <4/3, 0, 0> location camPos direction <0.0, 0.0, 1> angle camAngle look_at camLookAt } light_source { 0*x colour rgb lightCol translate lightDir*lightLen media_attenuation on } light_source { 0*x colour rgb 0.3*lightCol translate camPos media_attenuation off media_interaction off shadowless } #macro blobSph ( C, R, S, T ) #local Sa = abs(S); #if (Sa >= T) #local D = R * sqrt(1-sqrt(T/Sa)); #local N = 10; #local M = 0; #while (M < N) #local Sm = (M * T + (N - M) * Sa) / N; #local Rm = D / sqrt(1-sqrt(T/Sm)); sphere { 0, 1, ((S < 0)? -Sm: Sm)/N scale Rm translate C } #local M = M + 1; #end #else sphere { 0, 1, S scale R translate C } #end #end #macro blobCyl ( C1, C2, R, S, T ) #local Sa = abs(S); #if (Sa >= T) #local D = R * sqrt(1-sqrt(T/Sa)); #local N = 10; #local M = 0; #while (M < N) #local Sm = (M * T + (N - M) * Sa) / N; #local Rm = D / sqrt(1-sqrt(T/Sm)); cylinder { 0, (C2-C1)/Rm, 1, ((S < 0)? -Sm: Sm)/N scale Rm translate C1 } #local M = M + 1; #end #else cylinder { 0, (C2-C1)/R, 1, S scale R translate C1 } #end #end #declare Tg = 0.5; #declare S1 = 1; #declare R1 = 1.3; #declare YP = 1; #declare YM = -1; #declare Tex = texture { pigment { crackle solid colour_map { [0 rgb <1,0.7,0.4>*0.7] [1/3 rgb <0.7,1,.4>*0.7] [2/3 rgb 0.7] [1 rgb <1,0.7,0.4>*0.7] } } finish { diffuse 0.5 ambient 0 specular 0.6 metallic 0.5 } normal { crackle 0.2 slope_map {[0 <0,1>][0.1 <1,1>][0.1 <1,0>]} } scale 0.4 } blob { threshold Tg blobSph ( YP*y, R1, S1, Tg ) blobSph ( YM*y , R1, S1, Tg ) texture { Tex } scale 1.5 translate <-3,3,0> } blob { threshold Tg blobCyl ( <-1,YP,1>, <1,YP,-1>, R1, S1, Tg ) blobCyl ( <-1,YM,-1>, <1,YM,1>, R1, S1, Tg ) texture { Tex } scale 1.5 translate <3,3,0> } blob { threshold Tg sphere { YP*y, R1, S1 } sphere { YM*y , R1, S1 } texture { Tex } scale 1.5 translate <-3,-3,0> } blob { threshold Tg cylinder { <-1,YP,1>, <1,YP,-1>, R1, S1 } cylinder { <-1,YM,-1>, <1,YM,1>, R1, S1 } texture { Tex } scale 1.5 translate <3,-3,0> }