// This file draws a street lamp. // Written by Mark Slone - slone@hiwaay.net - July 2002 // POV-Ray 3.5 Settings // // The lamp is modeled after a streetlamp in Venice, Italy. // Glass #declare Glass_texture = texture { finish { metallic specular 0.50 roughness 0.1 reflection 0.3 } pigment { color rgbt <1.0, 1.0, 1.0, 0.8> } } // Copper (Verdigris) lamp texture #declare Copper_texture = texture { finish { metallic specular 0.50 roughness 0.01 reflection 0.10 } pigment { color rgb <0.0, 0.15, 0.10>} } // Iron rod texture #declare Iron_texture = texture { finish { metallic specular 0.50 roughness 0.01 reflection 0.10 } pigment { color rgb <0.0, 0.05, 0.05>} } // Shiny brass #declare Shiny_brass = texture { finish { brilliance 3 diffuse 0.4 metallic specular 0.50 roughness 0.001 reflection 0.25 } pigment { color rgb <0.9,.7,0.4> } } // A spiral made from blobs // Starts at 0 degrees // Number of blobs for each 180 degree rotation doubles // so that they all touch. // Originally created using POV-Ray 3.1, the spiral iron is drawn // using blobs, but a Spheresweep would probably work better. // Blobs are fine as long as the lamp is in the distance. #macro Spiral_iron(SpiralLoops, Thickness, ChopStart) #local StartRadius = 0.3; #local EndRadius = 0.7; #local SphereRadius = 0.04; #local SpiralDegrees = 0.0; #local DeltaRadius = (EndRadius - StartRadius)/SpiralLoops; #local CurrentRadius = StartRadius; #local SpiralRadius = 0.0; #local TransY = 0.0; #local Correction = sin((0.25)*3.1415926)*.3; object { // A blob to compose the 720 degree large spiral blob { threshold 0.5 // The initial large swirl #while ( CurrentRadius < EndRadius ) #if ( SpiralDegrees > ChopStart ) sphere { <0., 0., 0.>, SphereRadius*Thickness, 2.0 translate rotate SpiralDegrees*z translate <0., TransY, 0.0> } #end // Main spiral #if (SpiralDegrees < 720.0 ) #local SpiralDegrees = SpiralDegrees + 0.8*degrees(atan2(SphereRadius,CurrentRadius)); #local SphereRadius = 0.04 + 0.04*SpiralDegrees/int(SpiralLoops)/360.; #else // The extended section (720 - 810) #local SpiralDegrees = SpiralDegrees + (0.8 - Correction)*degrees(atan2(SphereRadius,CurrentRadius)); // Shrinks if larger piece, grows if smaller section #if ( SpiralLoops > 2.26 ) #local SphereRadius = 0.08 + 0.07*(SpiralDegrees-720.0)/SpiralLoops/360.; #else #local SphereRadius = 0.08 - 0.15*(SpiralDegrees-720.0)/SpiralLoops/360.; #end #local TransY = (SpiralDegrees - 720.0)*(SpiralDegrees - 720.0)/8100.0; #local Correction = sin((TransY*.5 + 0.25)*3.1415926)*.3 + TransY*0.4; //#debug concat ("TransY = ",str(TransY,7,4),"\n") //#debug concat ("Correction = ",str(Correction,7,4),"\n") #end #local CurrentRadius = StartRadius + DeltaRadius*(SpiralDegrees/360.); #local SpiralRadius = CurrentRadius*(SpiralDegrees/SpiralLoops/360.); //#debug concat ("\n\nAngle = ",str(SpiralDegrees,7,4),"\n") //#debug concat ("Radius = ",str(CurrentRadius,7,4),"\n") #end } // end of spiral blob texture { Iron_texture } } // end of object #end // of macro Sprial_iron // Slots into the lamp #declare Three_slots = #local SlotsAngle = 0; union { #while ( SlotsAngle < 360 ) object { box { <0., 0., -0.013>, <0.18, 0.16, 0.013> } translate <0.1, 0.0, 0.> rotate SlotsAngle*y } #local SlotsAngle = SlotsAngle + 18; #end translate <5.3, -.98, 0.> texture { Copper_texture } } // The glass shape #declare Three_glass = difference { union { cone { <0.0, 0.00, 0.>, 0.2, <0.0, -0.4, 0.>, 0.4 } // main cone torus { 0.25, 0.250 scale <0.8, 1.5, 0.8> translate <0.0, -0.45, 0.> } // bell shape } union { box { <-1., -0.4, -1>, <1.0, -2.0, 1.0> } torus { 0.3, 0.20 translate <0.0, 0.1, 0.> } // neck } } #declare Three_bulb = union { object { cone { <0.0, 0.0, 0.>, 0.05, <0.0, -0.12, 0.>, 0.08 } texture { Shiny_brass } } union { cone { <0.0, -0.12, 0.>, 0.05, <0.0, -0.2, 0.>, 0.08 } sphere { <0.0, -0.25, 0.>, 0.1 } finish { ambient 10.0 diffuse 0.0 } pigment { color rgb <1.,1.,1.> } } translate <0.0, 0.25, 0.0> } // The lamp (parts are 0.07' radius) #declare VeniceLamp = union { // The lamp union { // Mount and sheaths cylinder { <5.3, 0.2, 0.>, <5.3, -0.4, 0.>, 0.06 } cylinder { <5.3, 0.35, 0.>, <5.3, 0.0, 0.>, 0.04 } sphere { <5.3, 0.35, 0.>, 0.04 } sphere { <5.3, 0.30, 0.>, 0.06 } cylinder { <5.3, 0.15, 0.>, <5.3, -0.20, 0.>, 0.08 } // sheath // The body cylinder { <5.3, -0.40, 0.>, <5.3, -0.44, 0.>, 0.14 } difference { cone { <5.3, -0.44, 0.>, 0.19, <5.3, -1.0, 0.>, 0.22 } // main cone object { Three_slots } } difference { torus { 0.19, 0.06 translate <5.3, -0.53, 0.> } // large ring at top torus { 0.25, 0.04 translate <5.3, -0.59, 0.> } torus { 0.25, 0.04 translate <5.3, -0.47, 0.> } } torus { 0.19, 0.035 translate <5.3, -0.76, 0.> } // middle ring cone { <5.3, -1.0, 0.>, 0.22, <5.3, -1.05, 0.>, 0.28 } difference { cylinder { <5.3, -1.05, 0.>, <5.3, -1.15, 0.>, 0.28 } // base cylinder { <5.3, -1.05, 0.>, <5.3, -1.15, 0.>, 0.26 } // base } torus { 0.26, 0.035 translate <5.3, -1.10, 0.> } // base ring texture { Copper_texture } } // The glass // Lots of reflections, max trace level reached? difference { object { Three_glass translate <5.3, -1.08, 0.> } object { Three_glass scale 0.97 translate <5.3, -1.11, 0.> } texture { Glass_texture } } // The bulb (bulb color is white) and light source light_source { <5.3, -1.35, 0.0> color rgb < 1.0, 1.0, 1.0 > fade_distance 20.0 fade_power 2 looks_like { Three_bulb } media_interaction off } // The rod union { cylinder { <0.0, 0., 0.>, <5.5, 0., 0.>, 0.07 } cylinder { <5.5, 0., 0.>, <5.65, 0., 0.>, 0.04 } sphere { <5.60, 0., 0.>, 0.06 } sphere { <5.65, 0., 0.>, 0.04 } cylinder { <5.15, 0., 0.>, <5.45, 0., 0.>, 0.09 } texture { Iron_texture } } // Draw the spirals // Spiral_iron(SpiralLoops, Thickness, ChopStart) // Large end object { Spiral_iron(2.25, 1.0, 0.0) rotate -90*z translate <0.6, -0.50, 0.> } // Small end object { Spiral_iron(2.32, 1.39, 210.0) scale 0.5 rotate 90*z translate <3.4, -0.37, 0.> } // Inside spiral object { Spiral_iron(2.23, 1.15, 300.0) scale 0.48 rotate 135*z translate <2.02, -0.36, 0.> } // Left small spiral and joiner object { Spiral_iron(2.12, 1.25, 300.0) scale 0.42 rotate 180*x rotate 105*z translate <1.19, -0.38, 0.> } object { Spiral_iron(2.0, 1.2, 600.0) scale 0.42 rotate 180*x rotate -35*z translate <1.36, -0.31, 0.> } // Smallest right spiral object { Spiral_iron(2.32, 1.8, 340.0) scale 0.2 rotate 180*x rotate -83*z translate <2.6, -0.16, 0.> } } // end of union