home *** CD-ROM | disk | FTP | other *** search
- // POV-Ray 2.0 scene, by Dan Farmer 1993
- // Requires "corkbump.gif" for both the floor and the metal surfs
- // Copyright POV-Team 1993, Uesable and distributable under the
- // Freeware Spirit of POV-Ray.
- //----------------------
- #include "colors.inc"
- #include "textures.inc"
- #include "shapes.inc"
-
- // Modified copies of this base texture are used in some pieces
- #declare Bolt_Texture = texture {
- pigment {
- granite // Going for a galvanized appearance
- color_map {
- [0.0 color Gray70]
- [0.3 color Gray75]
- [0.6 color Gray85]
- [1.0 color Gray70]
- }
- scale <0.25, 0.25, 0.25>
- turbulence 0.15
- }
- finish {
- ambient 0.2
- diffuse 0.6
- reflection 0.1
- brilliance 10
- specular 0.35
- roughness 0.05
- }
- // Fuzz the surface with tiny ripples
- normal { ripples 0.25 frequency 2000 scale <0.05, 0.05, 0.05> }
- }
-
- // Primitive used for the hex edges of the nut
- #declare ZPlane = plane {z,1
- texture { Bolt_Texture
- normal {
- bump_map { gif "corkbump.gif"
- bump_size -0.75
- interpolate 0
- }
- translate <-0.5, -0.5, 0>
- scale <2, 1, 2>
- }
- }
- }
-
- // The end pieces are individually bumped
- #declare Hexagon = intersection {
- object { ZPlane }
- object { ZPlane rotate < 60, 0, 0>}
- object { ZPlane rotate <120, 0, 0>}
- object { ZPlane rotate <180, 0, 0>}
- object { ZPlane rotate <240, 0, 0>}
- object { ZPlane rotate <300, 0, 0>}
- plane {-x, 1
- texture { Bolt_Texture
- normal {
- bump_map { gif "corkbump.gif"
- bump_size -0.75
- interpolate 0
- }
- translate <-0.5, -0.5, 0>
- scale <2, 1, 2>
- rotate y*90
- }
- }
- }
- plane {x, 1
- texture { Bolt_Texture
- normal {
- bump_map { gif "corkbump.gif"
- bump_size -0.75
- interpolate 0
- }
- translate <-0.5, -0.5, 0>
- scale <2, 1, 2>
- }
- rotate y*90
- }
- }
- }
-
-
-
- // Rounded head with slot. Bump mapped for distressed look
- #declare Bolt_Head = intersection {
- difference {
- sphere { <0,0,0>, 1
- texture { Bolt_Texture
- normal {
- bump_map { gif "corkbump.gif"
- bump_size -0.5
- interpolate 0
- map_type Sphere_Map
- }
- }
- }
- }
- // Slot. x=depth, y = width
- box { <-1.1, -0.15, -1.1> <-0.15, 0.15, 1.1> }
- }
- box {<-1,-1,-1><0.35, 1, 1>}
- scale <0.75, 1.5, 1.5>
- rotate -x*45
- }
-
- // Filler for gaps between the threads, w/tapered end
- #declare Bolt_Shaft = union {
- object { Disk_X scale <2.5, 0.75, 0.75 > }
- cone { <2.5, 0,0>, 0.75, <2.65,0,0>,0.55 }
- }
-
- #declare TW=0.5 // Thread width
- // Basic thread primitive
- #declare Thread = union {
- cone { <-TW/2,0,0>, 0.75, <0,0,0>,1 }
- cone { < 0.0,0,0>, 1.00, <TW/2,0,0>,0.75 }
- rotate -z*7
- }
-
- // Put it all together for the bolt object
- #declare Bolt = union {
- object { Bolt_Head translate -x*2.5 }
- intersection {
- union {
- object { Bolt_Shaft }
- object { Thread translate x * 4.5 * TW }
- object { Thread translate x * 4.0 * TW }
- object { Thread translate x * 3.5 * TW }
- object { Thread translate x * 3.0 * TW }
- object { Thread translate x * 2.5 * TW }
- object { Thread translate x * 2.0 * TW }
- object { Thread translate x * 1.5 * TW }
- object { Thread translate x * 1.0 * TW }
- object { Thread translate x * 0.5 * TW }
- object { Thread translate x * 0.0 * TW }
- object { Thread translate -x * 0.5 * TW }
- object { Thread translate -x * 1.0 * TW }
- object { Thread translate -x * 1.5 * TW }
- object { Thread translate -x * 2.0 * TW }
- object { Thread translate -x * 2.5 * TW }
- object { Thread translate -x * 3.0 * TW }
- object { Thread translate -x * 3.5 * TW }
- object { Thread translate -x * 4.0 * TW }
- scale <1, 0.85, 0.85>
- }
- // Flatten the sharp edges on the thread, all in one fell-swoop
- cylinder {<-3.5, 0, 0> <2.75, 0, 0>, 0.83 }
- }
- texture { Bolt_Texture }
- bounded_by { cylinder {<-3.45, 0,0> <2.5,0,0>,1.5 } }
- }
-
- // And now the nut
- #declare NutRaw = object { Hexagon scale <0.65, 1.65, 1.65>
- bounded_by { box { <-1.01, -1.2, -1.01> <1.01,1.2,1.01> }
- scale <0.651, 1.651, 1.651>
- }
- }
- #declare Nut = intersection {
- object { NutRaw }
- sphere { <0,0,0>, 1.9 }
- texture { Bolt_Texture }
- scale <0.65, 1, 1>
- }
-
- // Place the bolt and nut
- #declare Nut_And_Bolt = union {
- object { Bolt rotate y * 180 }
- object { Nut rotate x * 30 translate <-1, 0, 0> }
- // rotate z*90
- // translate y*0.9
- // rotate -z*45 // Fall over
- }
-
- // "Distressed" cork surface on a plane
- #declare Floor = plane { y,-1.65
- texture {
- Cork
- scale <3,3,3>
- normal {
- bump_map { gif "corkbump.gif"
- bump_size -0.25
- interpolate 0
- }
- translate <-0.5, -0.5, 0>
- rotate x*90
- scale <160, 1, 160>
- translate <10,0,-320> // Purely cosmetic. Uses a better spot on the map
- }
- }
- }
-
- //--------------------- Camera and lights -------------------
-
- #declare StartCam =
- camera {
- location <10, 5, -35>
- direction <0, 0, 5.0>
- right <1.3333, 0, 0>
- look_at <0.5, 0 , 0>
- }
-
- #declare EndCam =
- camera {
- location <7, 5, -15>
- direction <0, 0, 2.75>
- right <1.3333, 0, 0>
- look_at <0.5, 0 , 0>
- }
- //camera { StartCam }
- camera { EndCam }
-
- light_source { <-15, 15, -5> color Gray20 fill_light }
- light_source { < 10, 15, -15> color Gray30 fill_light }
-
- light_source { <15, 5, -10> color Gray90
- // area_light <0 10 0> <0 0 4> 4 4
- // adaptive 1
- // jitter
- }
-
- background { color White }
-
- object { Nut_And_Bolt }
- object { Floor }
-