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

  1. // Generic Polyray input File
  2. // Polyray input file: Alexander Enzmann
  3.  
  4. // Set up the camera
  5. viewpoint {
  6.    from <0,0,-8>
  7.    at <0,0,0>
  8.    up <0,1,0>
  9.    angle 45
  10.    hither 1
  11.    resolution 160, 160
  12.    }
  13.  
  14. background <0, 0, 0>
  15. light <-10,10, -20>
  16. include "../colors.inc"
  17.  
  18. define v0 <1, 0, 0>
  19. define v1 rotate(v0, <0, 1, 0>, 120)
  20. define v2 rotate(v0, <0, 1, 0>, -120)
  21. define v3 rotate(v0, <0, 1, 0>, 60)
  22. define v4 rotate(v0, <0, 1, 0>, -60)
  23. define v5 rotate(v0, <0, 1, 0>, 180)
  24. define tri_fn max(P . v0, max(P . v1, P . v2))
  25. define hex_fn max(max(P . v0, max(P . v1, P . v2)),
  26.           max(P . v3, max(P . v4, P . v5)))
  27. define xtri_fn
  28.    (P . v0 > P . v1
  29.       ? (P . v0 > P . v2 ? P . v0 : P . v2)
  30.       : (P . v1 > P . v2 ? P . v1 : P . v2))
  31. define tri_lookup_fn |fmod(tri_fn, 1)|
  32. define hex_lookup_fn |fmod(hex_fn, 1)|
  33.  
  34. object {
  35.    sphere <0, 0, 0>, 2
  36.    texture {
  37.       special shiny { color white_marble_map[hex_lookup_fn] }
  38.       scale <0.3, 0.3, 0.3>
  39.       }
  40.    rotate <-45, 0, 0>
  41.    }
  42.