home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 1995 January / pcw-0195.iso / polyray / dat / texture / txttst.pi < prev    next >
Text File  |  1994-12-31  |  1KB  |  68 lines

  1. // Generic Polyray input File
  2. // Polyray input file: Alexander Enzmann
  3. //
  4. // Example of building a texture using object coordinates (P) versus
  5. // using world coordinates (W)
  6. //
  7.  
  8. // Set up the camera
  9. viewpoint {
  10.    from <0, 5, -5>
  11.    at   <0, 0,  0>
  12.    up   <0, 1,  0>
  13.    angle 30
  14.    resolution 160, 80
  15.    aspect 2
  16.    }
  17.  
  18. background black
  19. light <10, 10, -20>
  20.  
  21. define test_map
  22.    color_map(
  23.       [0,   0.3, <0, 0, 1>, <1, 0, 0>]
  24.       [0.3, 0.4, <1, 0, 0>, <0, 1, 0>]
  25.       [0.6, 1.0, <0, 1, 0>, <0, 0, 1>],
  26.       <1, 1, 1>)
  27.  
  28. // This texture moves with the object
  29. define test_map_texture0
  30. texture {
  31.    special surface {
  32.       color test_map[fmod(fabs(P[0]), 1.0)]
  33.       ambient 0.2
  34.       diffuse 0.8
  35.       specular white, 0.5
  36.       microfacet Reitz 10
  37.       }
  38.    }
  39.  
  40. // This texture stays in place
  41. define test_map_texture1
  42. texture {
  43.    special surface {
  44.       color test_map[fmod(fabs(W[0]), 1.0)]
  45.       ambient 0.2
  46.       diffuse 0.8
  47.       specular white, 0.5
  48.       microfacet Reitz 10
  49.       }
  50.    }
  51.  
  52. object {
  53.    sphere <0, 0, 0>, 1
  54.    test_map_texture0
  55.    translate <-2.5, 0, 0>
  56.    }
  57.  
  58. object {
  59.    sphere <0, 0, 0>, 1
  60.    test_map_texture0
  61.    }
  62.  
  63. object {
  64.    sphere <0, 0, 0>, 1
  65.    test_map_texture1 { translate <2.5, 0, 0> }
  66.    translate <2.5, 0, 0>
  67.    }
  68.