home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 1995 January / pcw-0195.iso / polyray / dat / animate / texanim / wireanim.pi < prev   
Text File  |  1994-12-31  |  1KB  |  56 lines

  1. //
  2. // Texture that simulates the "screen" shader in the Renderman Companion
  3. //
  4. // Polyray input file: Alexander Enzmann
  5.  
  6. start_frame 0
  7. end_frame 60
  8.  
  9. define t0 0
  10. define t1 end_frame
  11. define increment (frame - t0) / (t1 - t0)
  12.  
  13. // Set up the camera
  14. viewpoint {
  15.    from <0,5,-7>
  16.    at <0,0,0>
  17.    up <0,1,0>
  18.    angle 45
  19.    resolution 256, 256
  20.    }
  21.  
  22. background <0, 0, 0>
  23. light <-10, 20, -20>
  24.  
  25. include "../../colors.inc"
  26.  
  27. define density increment
  28. define freq 3
  29.  
  30. //
  31. // "wire_exper" returns 1 if we are on the visible part of the surface,
  32. // and returns 0 if we are on the see-through part of the surface.
  33. //
  34. define wire_exper (|fmod(freq * P[0], 1)| < density ? 1
  35.                      : (|fmod(freq * P[1], 1)| < density ? 1 : 0))
  36. define wire_red
  37. texture {
  38.    special surface {
  39.       ambient wire_exper * red, 0.1
  40.       diffuse wire_exper * red, 0.4
  41.       specular wire_exper * white, 0.5
  42.       microfacet Reitz 10
  43.       transmission white, 1 - wire_exper, 1.0
  44.       }
  45.    }
  46.  
  47. object {
  48.    sphere <0, 0, 0>, 2
  49.    wire_red
  50.    }
  51.  
  52. object {
  53.    disc <0, -2, 0>, <0, 1, 0>, 10
  54.    texture { checker matte_white, matte_black }
  55.    }
  56.