home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Raytrace & Morphing / SOS-RAYTRACE.ISO / programm / scripts / pov / key.inc < prev    next >
Encoding:
Text File  |  1993-10-18  |  2.7 KB  |  105 lines

  1. // Persistence of Vision Raytracer 2.0
  2. // Image by Peter McArdle 72130,3147
  3. // Give credit where due
  4. // Key.inc
  5. // This a scene file that describes a skeleton key
  6. /*
  7.    It is based on one unit = approx one inch
  8.    (now you can scale it to fit your scene!)
  9.    x Handle side at orgin. Other side at 3.1640625 units
  10.    y Top 13/32 units. Bottom -9.8/16 units
  11.    z Thickness at thickest point 2/16 units
  12.    (now you can translate and rotate it to fit your scene!)
  13.    invoke with ( object { Key } )
  14. */
  15.  
  16. // Take out the #include files below if they are in your main scene before Key.inc
  17. #include "colors.inc"    // pre-defined colors
  18. #include "shapes.inc"    // pre-defined scene elements
  19. #include "textures.inc"  // pre-defined surface textures
  20.  
  21. // Take out the camara if you are useing this as an include file
  22. camera {
  23.   location  <1.5,  0.0, -5.0>
  24.   direction <0.0,  0.0,  1.5>
  25.   up        <0.0,  1.0,  0.0>
  26.   right     <4/3,  0.0,  0.0>
  27.   look_at   <1.5,  0.0,  0.0>
  28.   sky       <0.0,  1.0,  0.0>
  29.  }
  30.  
  31. // Same as camera
  32. //Light source
  33. object {
  34.   light_source { <5, 10, -35> color White } 
  35.  }
  36.  
  37. #declare Key_Texture =
  38.  texture {
  39.     pigment { Silver }
  40.     normal { dents 1 }
  41.     finish { phong 1 metallic }
  42.     scale <1/144, 1/144, 1/144 >
  43.    }
  44.  
  45. // Key Handle
  46. #declare Key_Handle =
  47. object {
  48.   difference {
  49.     intersection { 
  50.       sphere { <0, 0, 0> 13/32 scale <.76923076923, 1, 1> translate <5/16, 0, 0>}
  51.       plane { z, -1/16 }
  52.       plane { -z, 1/16 }
  53.      }
  54.     union { 
  55.       cylinder { <5/16, 0, -1>, <5/16, 0, 1>, 3/16 translate y*4.5/32 }
  56.       cylinder { <5/16, 0, -1>, <5/16, 0, 1>, 3/16 translate y*-4.5/32 }
  57.       box { <5/16, -.140625, -1> < 8/16, .140625, 1> }
  58.      }
  59.    }
  60.   texture {
  61.     Key_Texture
  62.    }
  63.   bounded_by { sphere {<5/16, 0, 0> 13.1/32  } }
  64. }  // End Key Handle
  65.  
  66. // Key Shaft
  67. #declare Key_Shaft =
  68. object { 
  69.   union {
  70.     sphere { <0, 0, 0> 2.5/32  scale <.5, 1, 1> translate <5/8, 0, 0> }
  71.     cone { <5/8 0, 0>, 2.5/32 <37/16, 0, 0>, 3.1/32 }
  72.     sphere { <0, 0, 0> 2/16 scale <.75, 1, 1> translate x*37/16 }
  73.     cylinder { <37/16, 0, 0>, <49/16, 0, 0>, 3.25/32 }
  74.     sphere { <49/16, 0, 0> 3.25/32 }
  75.    }
  76.   texture {
  77.     Key_Texture
  78.    }
  79.   bounded_by { box { <17.4/32, -2.1/16, -2.1/16> <51/16, 2.1/16, 2.1/16> } }
  80.  } //End Key Shaft
  81.  
  82. // Key Protrusion
  83. #declare Key_Protrusion =
  84. object {
  85.   union {
  86.     box { <0.0, -1/16, -1/16> <6/16, 0.0, 1/16> }
  87.     box { <1.5/16, -4.5/16, -1/16> <4.5/16, -1/16, 1/16> }
  88.     box { <0.0, -6.6/16, -1/16> <6/16, -4.5/16, 1/16> }
  89.     translate <40.0/16, -3.2/32, 0>
  90.    }
  91.   texture {
  92.     Key_Texture
  93.    }
  94.  }
  95.  
  96. // Key
  97. #declare Key =
  98. union {
  99.   object { Key_Handle }
  100.   object { Key_Shaft }
  101.   object { Key_Protrusion }
  102.  }
  103.  
  104. // The Key remove or scale, rotate, translate to fit your scene 
  105. object { Key }