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

  1. // Generic Polyray input File
  2. // Polyray input file: Alexander Enzmann
  3.  
  4. // Set up the camera
  5. viewpoint {
  6.    from <0, 6, -8>
  7.    at <0,0,0>
  8.    up <0,1,0>
  9.    angle 60
  10.    hither 1
  11.    resolution 160, 160
  12.    }
  13.  
  14. background <0, 0, 0>
  15. light <-10,3, -20>
  16. include "..\colors.inc"
  17.  
  18. // A displacement function using the variables u and v that builds
  19. // spikes and ridges on a sphere
  20. define displace_fn
  21.    (((u > 0.0  && u < 0.05 && v > 0.45 && v < 0.55) ||
  22.      (u > 0.25 && u < 0.3  && v > 0.45 && v < 0.55) ||
  23.      (u > 0.5  && u < 0.55 && v > 0.45 && v < 0.55) ||
  24.      (u > 0.75 && u < 0.8  && v > 0.45 && v < 0.55) ||
  25.      (v > 0.95)) ? 1 :
  26.     (((u > 0.125 && u < 0.175) ||
  27.       (u > 0.375 && u < 0.425) ||
  28.       (u > 0.625 && u < 0.675) ||
  29.       (u > 0.875 && u < 0.925)) ? 0.2 : 0))
  30.  
  31. define two_sphere
  32. object {
  33.    sphere <0, 0, 0>, 2
  34.    displace 2 * N * displace_fn
  35.    uv_steps 64, 64
  36.    shiny_red
  37.    }
  38.  
  39. two_sphere
  40.