#version 3.7; #declare Radiosity = off; #declare Bells = 8; global_settings { assumed_gamma 1 #if (Radiosity) radiosity { pretrace_start 0.04 pretrace_end 0.01 count 200 recursion_limit 3 nearest_count 10 error_bound 0.5 } #end } #default {finish {ambient 0 diffuse 0.75}} //------------------------------------------ // SDL for StoneHenge // Bill Walker - 2017 //------------------------------------------ #include "colors.inc" #include "functions.inc" //#include "iw_textures.inc" //#include "isowood3.inc" #include "shapes.inc" #include "shapes2.inc" #include "shapes3.inc" #include "stones1.inc" #include "stones2.inc" #include "textures.inc" //#include "vectors.inc" #declare Aspect = image_width/image_height; #declare Feet = 12; #declare Meters = 3.28084*Feet; camera { location <65*Feet, 3*Feet, -100*Feet> right x*Aspect look_at <-10*Feet, 30*Feet, 50*Feet> } #declare Environment = sphere { 0, 1 hollow on material { texture { uv_mapping pigment { image_map { //hdr "ArboretumInBloom_Ref.hdr" //hdr "hdrvfx_chanc_00003_node_01_v_005_3k_Ref.hdr" //hdr "PaperMill_E_3k.hdr" //hdr "skyline_02_stitch_v001_3_5k_Ref.hdr" //hdr "Summi_Pool_3k.hdr" hdr "Milkyway_small.hdr" gamma 1.5 map_type 0 interpolate 2 once } } finish {emission 1} } interior { ior 1.0 } } no_shadow rotate y*45 } object { Environment scale 1000*Feet} #if (!Radiosity) light_source { <150*Feet, 100*Feet, -300*Feet> color rgb <1, 1, 0.4>} // Key light light_source { <-75*Feet, 20*Feet, -300*Feet> color rgb <1, 1, 0.4>*0.5} // Fill light light_source { < 0*Feet, 100*Feet, 500*Feet> color rgb <1, 1, 0.4> // Rim light spotlight // this kind of light source point_at <0, 15*Feet, 0> // direction of spotlight radius 100*Feet // hotspot (inner, in degrees) tightness 50 // tightness of falloff (1...100) lower is softer, higher is tighter falloff 30 // intensity falloff radius (outer, in degrees) } #end //plane {y, 0 pigment {Green*0.2}} /* union { // NORTH ARROW cylinder {<0, 0, -500*Feet>, <0, 0, 500*Feet> 6} cone {<0, 0, 500*Feet>, 12, <0, 0, 510*Feet>, 0} text { ttf "arial.ttf", "N", 0.02, 0.0 scale 10 translate z*520*Feet} texture {pigment {White} finish {specular 0.6}} } */ // ground union { difference { cylinder {<0, 0, 0>, <0, -50*Feet, 0> 500*Feet} // Ground disk torus {160*Feet, 10*Feet scale <1, 6/10, 1>} // ditch /* #for (Aubrey, 0, 55) cylinder {<0, -0.76*Meters, 0>, <0, 0.1, 0> 0.53*Meters // Aubrey holes translate z*((140*Feet)-(5*Meters)) rotate y*((Aubrey*360/56)-2) texture {pigment {White} finish {specular 0.6}} } #end #for (Y, 0, 29) cone {<0, -0.76*Meters, 0>, 1.3*Meters/2, <0, 0.1, 0> 0.5*Meters // Y holes scale <1, 1, 0.5> translate z*(27*Meters) rotate y*((Y*360/30)) texture {pigment {Green} finish {specular 0.6}} } #end #for (Z, 0, 29) cone {<0, -0.76*Meters, 0>, 1.3*Meters/2, <0, 0.1, 0> 0.5*Meters // Z holes scale <1, 1, 0.5> translate z*(19.5*Meters) rotate y*((Z*360/30)) texture {pigment {Blue} finish {specular 0.6}} } #end */ } torus {140*Feet, 10*Feet scale <1, 6/20, 1>} // inner bank torus {23.25*Meters, 4 scale <1, 1, 1>} // Between Y and Z circles torus {14.75*Meters, 4 scale <1, 1, 1>} // Inside Z circle //torus {(97+1/3)*Feet/2, 4 scale <1, 1, 1> texture {pigment {Red} finish {specular 0.6}}} // Sarsen circle marker //torus {10*Feet, 4 scale <1, 1, 1> texture {pigment {Blue} finish {specular 0.6}}} // Bluestone circle marker texture {pigment {Green*0.2} normal {bozo scale <120, 10, 120>}} } #declare RMF = function {(f_ridged_mf ((4+x)/0.3, y/0.3, z/0.3, 0.5, 2.7, 4, 1, 1.5, 0)-1.8)*0.5}; #declare N2 = normal { average normal_map { [1 bumps scale 0.175 bump_size 0.15] [1 bumps scale 0.35 bump_size 0.15] [1 function { RMF(x, y, z) } scale 0.1 bump_size 0.125 slope_map { [0 <0,1>] [0.25 <1,0>] [1 <1,0>] }] } accuracy 1e-3 scale 0.05 } #declare mtex = texture { pigment {color rgb <1, 0.952, 0.818>} normal {facets coords 0.024 scale 0.1} //normal {N2} finish { brilliance 2 specular 0.5 roughness 0.01 metallic //reflection {0.8 metallic} reflection {0.6 metallic} ambient 0 diffuse 0.05 conserve_energy } } #declare dtex = texture { pigment {color rgb 1} normal {bumps 0.2 sine_wave scale 0.01} finish { brilliance 1 specular 0.3 roughness 0.03 reflection {0, 0.8 fresnel on} ambient 0 diffuse 0.15 conserve_energy } } #declare unnamed_material_ = material { texture { pigment_pattern { average pigment_map { [1 wrinkles scale 0.02] [1 wrinkles scale 0.063] [1 wrinkles scale 0.2] } } texture_map { [0.5 mtex] [1 dtex] } } interior {ior 2.5} //scale 10 scale 100 } #declare bellSpline = array [12] { < 3.4688, 0.0001>, < 3.4688, 0.0002>, < 3.0938, 0.4375>, < 2.9375, 0.6250>, < 2.4844, 1.3438>, < 2.1719, 2.6094>, < 2.0469, 4.4688>, < 1.9063, 4.6875>, < 1.7500, 4.8750>, < 1.0313, 5.0938>, < 0.0001, 5.1563>, < 0.0001, 5.1564> } //============================================================================================================ // braided rope handle #declare Lines = 5; #declare Pitch = 2; #declare Degree = (1/360); #declare Rad = 0.002; // sphere radius #declare Dia = Rad * 2; #declare Cycles = 1; #declare Freq = 1; #declare R1 = 0.05; // radius of large spiral #declare A = 0.01; //radius of small spiral //#declare B = 1.5; #declare H = 0.002; //large spiral pitch smaller = tighter #declare W = 8; // pitch of small spiral - how many cycles around one loop #declare C = 0.01; // amplitude of undulation 1 #declare U = 0.1; // undulation 2 #declare STEPS = 0.002*10; #declare Strand1 = union { #for (i, -(Cycles/2)*360, (Cycles/2)*360, STEPS) #declare R = R1+(C*sin(U*i)); // adds undulation to cylindrical braid #local Angle = Degree * i; #local j = i + 45; /// rotates green strand 45 deg from red #local Helix1_X = (R+A*cos(W*i))*cos(i); #local Helix1_Z = (R+A*cos(W*i))*sin(i); sphere {<0, 0, 0> Rad translate } //weave #end // end for i } // end union #declare Strand2 = union { #for (i, -(Cycles/2)*360, (Cycles/2)*360, STEPS) #declare R = R1+(C*sin(U*i)); // adds undulation to cylindrical braid #local Angle = Degree * i; #local j = i + 45; /// rotates green strand 45 deg from red #local Helix2_X = (R+A*cos(W*j))*sin(j); #local Helix2_Z = (R+A*cos(W*j))*cos(j); sphere {<0, 0, 0> Rad translate } //weave #end // end for i } // end union #declare AllStrands = union { #for (k, 1, W, 2) object {Strand1 rotate y*k*(360/W)} object {Strand2 rotate y*k*(360/W)} #end // end for k } #declare Handle = object {AllStrands texture {pigment {White} normal {bumps 0.01}} scale 2}; //============================================================================================================ #declare arraySize = dimension_size (bellSpline, 1)-1; #declare Rad = 0.1; #declare Xmax = 0; #declare Ymax = 0; #declare Bell1 = union { cylinder {<0, 0, 0>, <0, (5.0938/2)+1, 0> 0.125} sphere {0, 0.25} torus {0.125, 0.125/4 rotate x*90 translate -y*0.25} object {Handle translate -y*1} sor { arraySize+1, #for (B, 0, arraySize) #local NewSpline = bellSpline [B]/2; //#debug concat ("B = ", str (B, 3, 1), "| Point = ", vstr (2, bellSpline [B], ",", 5, 1), "\n") #declare Xmax = max (Xmax, NewSpline.x); #declare Ymax = max (Ymax, NewSpline.y); NewSpline, #end open } //texture { T_Gold_1B } texture { mtex } //pigment {rgb <1, 1, 0>} translate -((5.0938/2)+0.5) } #declare Theta = degrees(atan2 (4, 1168)); #declare SBreadth = ((3*Feet)+4)*2; #declare SHeight = 13.5*Feet*2; #declare SDepth = 3.5*Feet; #declare Stone = texture {pigment {White_Marble} normal {marble 1} finish {phong 0.5} scale 5 } // end of texture #for (Sarsen, 0, Bells-1) box {<-SBreadth/2, 0, 0>, translate z*(97+1/3)*Feet/2 #if (Sarsen = 0 ) rotate -y*Theta #end // 4" offset #if (Sarsen = 29) rotate y*Theta #end // 4" offset rotate y*((Sarsen*360/Bells)) texture {Stone} } #end #declare AA = ((97+1/3)*Feet/2); #declare BB = ((97+1/3)*Feet/2)+(3.5*Feet); #declare EE = 15; #declare LgConeHeight = 1.3*Feet*2; #declare LgConeWidth = 3.25*Feet*4; #declare SmConeHeight = LgConeHeight*(AA/BB); #declare SmConeWidth = LgConeWidth*(AA/BB)*4; #declare Adj = abs (BB - AA); #declare Opp = 1 * LgConeHeight; #declare Theta = degrees (atan2 (Opp, Adj)); #declare Sweep = (360/Bells)-0.25; #declare LStone2 = difference { object { Segment_of_CylinderRing ( BB, // major radius, AA, // minor radius, 2.6*Feet*2, // height H, Sweep // angle (in degrees) ) // end macro call rotate -y*(90+(Sweep/2)) } cone { <0, 0, AA-EE>, 1*(AA/BB), <0, 0, BB+EE>, 1 scale } rotate -y*(Sweep/2) translate y*SHeight texture {Stone scale 1.5} } // end of difference #for (Lintel, 0, Bells-1) object {LStone2 rotate y*Lintel*(360/Bells)} object {Bell1 scale 60 translate z*(BB+(11.5*Feet)) rotate y*(39+Lintel*(360/Bells)) translate y*(SHeight+LgConeHeight)} #end #declare Interior = interior { media { intervals 1 samples 10 emission <1,1,1> absorption <0,0,0> scattering { 1, <0,0,0> } //confidence 0.99 //variance 1/100 density { gradient y scale 500 } } } //Spiral #declare Cycles = 10; #declare Start = 200*Feet; #for (Theta, 0, 360*Cycles, 0.5) #declare Rad = Start - Theta * (Start/(360*Cycles)); sphere { 0, 60 translate rotate -y*((Theta/Cycles)-90) texture {pigment {rgb 1} finish {emission 1}} } #end // determine camera-to-LookAt vector // create perpendicular vector // calculate angle between perp and x-axis // rotate text by -y*angle #declare Loc = <65*Feet, 3*Feet, -100*Feet>; #declare LA = <-10*Feet, 30*Feet, 50*Feet>; #declare View = Loc - LA; #declare Perp = VPerp_To_Plane(View, y); #declare PX = VProject_Plane(Perp, y) #declare PY = VProject_Plane(Perp, x) #declare AngleY = VAngleD (PX, x); #declare AngleX = VAngleD (PY, z); text { ttf "arial.ttf", "The tolling of the eighth bell signaled the transcendence of this mortal coil. These bells toll for thee.", 1, 0 // thickness, offset texture {pigment {color rgb <1, 0.75, 0>} normal {bumps 0.5 scale 0.01} finish {specular 1 reflection 0.25} } // end of texture scale <1,1.5,1> rotate x*AngleX rotate -y*AngleY translate <55*Feet, 2, -90*Feet> } // end of text object ---------------------------------------------