home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Raytrace & Morphing / SOS-RAYTRACE.ISO / programm / scripts / polyray / pots / gougepot.pi < prev    next >
Encoding:
Text File  |  1993-06-24  |  2.5 KB  |  75 lines

  1. // "Gougepot" a Polyray 1.6 scene file based on the "Utah Teapot"
  2. // By Douglas Otwell
  3. //----------------------------------------------------------------------------
  4. // In Gougepot, I use noise in the displacement function to get a random
  5. // gouged-out texture by displacing the surface in the opposite direction to
  6. // the surface normal, if the noise is over a certain threshold.  I'm also
  7. // using Polyray's texture_map to determine the texture (wooden or shiny_red)
  8. // based on the same noise function.
  9. //----------------------------------------------------------------------------
  10.  
  11. // point these to the standard Polyray include files
  12. include "../colors.inc"
  13. include "../texture.inc"
  14.  
  15. viewpoint {
  16.    from <0, 4, -5.0>
  17.    at <0.25, 1, 0>
  18.    up <0, 1, 0>
  19.    angle 53
  20.    resolution 640, 480
  21.    aspect 1.33333
  22. }
  23.  
  24. background SkyBlue
  25. light <-10, 10, -5>
  26. light <10, 10, -10>
  27.  
  28. //----------------------------------------------------------------------------
  29. // This is the teapot texture.  The texture map is indexed 
  30. // with the same function as used for the displacement surface
  31. //----------------------------------------------------------------------------
  32. define lacquered_wood_texture texture {
  33.    indexed noise(6 * P, 1), 
  34.    texture_map ([0.0, 0.6, shiny_red, shiny_red],
  35.                 [0.6, 1.0, wooden {scale <0.1, 0.1, 0.1>}, 
  36.                            wooden {scale <0.1, 0.1, 0.1>}]
  37.    )
  38. }
  39.  
  40. define rim_texture    lacquered_wood_texture
  41. define body1_texture  lacquered_wood_texture
  42. define body2_texture  lacquered_wood_texture
  43. define spout_texture  lacquered_wood_texture
  44. define handle_texture lacquered_wood_texture
  45. define lid1_texture   lacquered_wood_texture 
  46. define lid2_texture   lacquered_wood_texture
  47. define bottom_texture lacquered_wood_texture
  48.  
  49. //----------------------------------------------------------------------------
  50. // Here's the displacement function.  If the noise value is greter than the 
  51. // threshold, then the difference is used to displace the surface inward,
  52. // in the direction opposite to the normal, N.
  53. //----------------------------------------------------------------------------
  54. define gouge_fn  
  55.    (noise(6 * P, 1) > 0.6 
  56.    ? (noise(6 * P, 1) - 0.6) * N * -0.5
  57.    : 0)
  58.  
  59. define rim_fn    gouge_fn
  60. define body1_fn  gouge_fn
  61. define body2_fn  gouge_fn
  62. define lid1_fn   gouge_fn
  63. define lid2_fn   gouge_fn
  64. define spout_fn  gouge_fn
  65. define handle_fn gouge_fn
  66. define bottom_fn gouge_fn
  67.  
  68. define u_res 8
  69. define v_res 8
  70.  
  71. include "mypot.inc"
  72.  
  73. teapot 
  74.  
  75.