home *** CD-ROM | disk | FTP | other *** search
- // Persistence of Vision Raytracer 2.0
- // Image by Peter McArdle 72130,3147
- // Give credit where due
- // Key.inc
- // This a scene file that describes a skeleton key
- /*
- It is based on one unit = approx one inch
- (now you can scale it to fit your scene!)
- x Handle side at orgin. Other side at 3.1640625 units
- y Top 13/32 units. Bottom -9.8/16 units
- z Thickness at thickest point 2/16 units
- (now you can translate and rotate it to fit your scene!)
- invoke with ( object { Key } )
- */
-
- // Take out the #include files below if they are in your main scene before Key.inc
- #include "colors.inc" // pre-defined colors
- #include "shapes.inc" // pre-defined scene elements
- #include "textures.inc" // pre-defined surface textures
-
- // Take out the camara if you are useing this as an include file
- camera {
- location <1.5, 0.0, -5.0>
- direction <0.0, 0.0, 1.5>
- up <0.0, 1.0, 0.0>
- right <4/3, 0.0, 0.0>
- look_at <1.5, 0.0, 0.0>
- sky <0.0, 1.0, 0.0>
- }
-
- // Same as camera
- //Light source
- object {
- light_source { <5, 10, -35> color White }
- }
-
- #declare Key_Texture =
- texture {
- pigment { Silver }
- normal { dents 1 }
- finish { phong 1 metallic }
- scale <1/144, 1/144, 1/144 >
- }
-
- // Key Handle
- #declare Key_Handle =
- object {
- difference {
- intersection {
- sphere { <0, 0, 0> 13/32 scale <.76923076923, 1, 1> translate <5/16, 0, 0>}
- plane { z, -1/16 }
- plane { -z, 1/16 }
- }
- union {
- cylinder { <5/16, 0, -1>, <5/16, 0, 1>, 3/16 translate y*4.5/32 }
- cylinder { <5/16, 0, -1>, <5/16, 0, 1>, 3/16 translate y*-4.5/32 }
- box { <5/16, -.140625, -1> < 8/16, .140625, 1> }
- }
- }
- texture {
- Key_Texture
- }
- bounded_by { sphere {<5/16, 0, 0> 13.1/32 } }
- } // End Key Handle
-
- // Key Shaft
- #declare Key_Shaft =
- object {
- union {
- sphere { <0, 0, 0> 2.5/32 scale <.5, 1, 1> translate <5/8, 0, 0> }
- cone { <5/8 0, 0>, 2.5/32 <37/16, 0, 0>, 3.1/32 }
- sphere { <0, 0, 0> 2/16 scale <.75, 1, 1> translate x*37/16 }
- cylinder { <37/16, 0, 0>, <49/16, 0, 0>, 3.25/32 }
- sphere { <49/16, 0, 0> 3.25/32 }
- }
- texture {
- Key_Texture
- }
- bounded_by { box { <17.4/32, -2.1/16, -2.1/16> <51/16, 2.1/16, 2.1/16> } }
- } //End Key Shaft
-
- // Key Protrusion
- #declare Key_Protrusion =
- object {
- union {
- box { <0.0, -1/16, -1/16> <6/16, 0.0, 1/16> }
- box { <1.5/16, -4.5/16, -1/16> <4.5/16, -1/16, 1/16> }
- box { <0.0, -6.6/16, -1/16> <6/16, -4.5/16, 1/16> }
- translate <40.0/16, -3.2/32, 0>
- }
- texture {
- Key_Texture
- }
- }
-
- // Key
- #declare Key =
- union {
- object { Key_Handle }
- object { Key_Shaft }
- object { Key_Protrusion }
- }
-
- // The Key remove or scale, rotate, translate to fit your scene
- object { Key }