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

  1. //
  2. // Diplacement map: make the threads on a light bulb from a cylinder
  3. // Note: you have to use scan conversion for this file to work correctly
  4. //
  5. //start_frame 0
  6. //end_frame 59
  7.  
  8. // Generic Polyray input File
  9. // Polyray input file: Alexander Enzmann
  10.  
  11. define km      0.1
  12. define freq    5.0
  13. define phas    frame / 60
  14. define offset  0.0
  15. define damp    0.1
  16.  
  17. // Set up the camera
  18. viewpoint {
  19.    from <0, 3,-15>
  20.    at <0,0,0>
  21.    up <0,1,0>
  22.    angle 30
  23.    hither 1
  24.    resolution 160, 160
  25.    }
  26.  
  27. background white
  28. light <-10,3, -20>
  29.  
  30. define shiny_red
  31. texture {
  32.    surface {
  33.       ambient red, 0.2
  34.       diffuse red, 0.8
  35.       specular white, 0.7
  36.       microfacet Reitz 10
  37.       }
  38.    }
  39.  
  40. define disp_fn
  41.    ((sin(2.0 * 3.14159 * (v * freq + 2.0 * u + phas)) + offset) * km) *
  42.       (v < damp
  43.      ? (v / damp)
  44.      : (v > (1 - damp) ? (1 - v) / damp : 1.0))
  45.  
  46. object {
  47.    cylinder <0, -2, 0>, <0, 2, 0>, 2
  48.    shiny_red
  49.    uv_steps 32, 64
  50.    displace N * disp_fn
  51.    }
  52.  
  53. if (0 == 1) {
  54. object {
  55.    cone <0, -2, 0>, 2, <0, -3, 0>, 0.5
  56.    shiny_red
  57.    }
  58. object {
  59.    disc <0, -3, 0>, <0,-1, 0>, 0.3, 0.5
  60.    shiny_red
  61.    }
  62. object {
  63.    cylinder <0, -3, 0>, <0, -3.5>, 0.3
  64.    shiny_red
  65.    }
  66. }
  67.