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

  1. // "Dalipot" a Polyray 1.6 scene file based on the "Utah Teapot"
  2. // By Douglas Otwell
  3. //----------------------------------------------------------------------------
  4. // In Dalipot, I use a power function to displace the pot downwards.  The
  5. // texture, an image map, follows the displacement of the surface using
  6. // the local coordinate mapping ability of Polyray.                        
  7. //----------------------------------------------------------------------------
  8.  
  9. // point these to the standard Polyray include files
  10. include "../colors.inc"
  11. include "../texture.inc"
  12.  
  13. viewpoint {
  14.    from <2, 3, -6.5>
  15.    at <0,0.5,0>
  16.    up <0,1,0>
  17.    angle 45
  18.    //resolution 160, 120
  19.    //aspect 1.33333 / 1.2
  20.    resolution 640, 480
  21.    aspect 1.33333
  22. }                
  23.  
  24. background skyblue
  25. light <20, 4, 0>
  26. light <-10, 6, -15>
  27.  
  28. //----------------------------------------------------------------------------
  29. // Pattern_texture uses an image mapped to the u and v coordinates of 
  30. // the bezier.  This way the image follows the displacement of the bezier.
  31. //----------------------------------------------------------------------------
  32. define pattern_texture      
  33. texture {
  34.    special surface {
  35.       color planar_imagemap (image ("pattern.tga"), <v, 0, -u>, 1)
  36.       specular white, 0.6
  37.       microfacet Reitz 5
  38.    }
  39. }
  40. define white_texture
  41. texture {
  42.    surface {
  43.       color <0.847, 0.847, 0.847>
  44.       specular white, 0.6
  45.       microfacet Reitz 5
  46.    }
  47. }
  48.  
  49. define rim_texture    white_texture
  50. define body1_texture  pattern_texture
  51. define body2_texture  white_texture
  52. define spout_texture  white_texture
  53. define handle_texture white_texture
  54. define lid1_texture   white_texture 
  55. define lid2_texture   white_texture
  56. define bottom_texture white_texture
  57.  
  58. //----------------------------------------------------------------------------
  59. // This function will displace the pot downwards proportional to x^2
  60. //----------------------------------------------------------------------------
  61. define dali_fn (x > -0.2 
  62.    ? <0, -0.5 * (x + 0.2)^2, 0> 
  63.    : 0)
  64.  
  65. define rim_fn    dali_fn
  66. define body1_fn  dali_fn
  67. define body2_fn  dali_fn
  68. define lid1_fn   dali_fn
  69. define lid2_fn   dali_fn
  70. define spout_fn  dali_fn
  71. define handle_fn dali_fn
  72. define bottom_fn dali_fn
  73.  
  74. define u_res 5
  75. define v_res 5
  76.  
  77. include "mypot.inc"
  78.  
  79. teapot
  80.  
  81. object {
  82.    box <-4, -4, -2>, <0, 0, 2> 
  83.    shiny_red
  84.    translate <-0.2, 0, 0>
  85. }
  86.  
  87.