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

  1. // Sample file demonstrating the mapping of an image onto a box
  2. // Polyray input file: Alexander Enzmann
  3.  
  4. viewpoint {
  5.    from <0,3,-10>
  6.    at <0,0,5>
  7.    up <0,1,0>
  8.    angle 45
  9.    resolution 160, 160
  10.    }
  11.  
  12. // Get various surface finishes
  13. include "..\colors.inc"
  14.  
  15. // Set up background color & lights
  16. background <0, 0, 0>
  17. light white, <10, 20, -50>
  18.  
  19. // Pull in a Targa file - note that "m22u.tga" is a 16 bit Targa, and having
  20. // been created by Polyray, all parts of the image that hit the background
  21. // have the alpha bit set.  This means that unless we take steps to turn
  22. // off the transparency, we will be able to see through the background parts
  23. // of the image
  24. define ball_image image("m22u.tga")
  25. define box_image_texture
  26. texture {
  27.    special surface {
  28.       color planar_imagemap(ball_image, P, 1)
  29.       ambient 0.2
  30.       diffuse 0.8
  31.       }
  32.    }
  33.  
  34. define ball_image_texture
  35. texture {
  36.    special surface {
  37.       color spherical_imagemap(ball_image, P)
  38.       ambient 0.2
  39.       diffuse 0.8
  40.       transmission 0, 1
  41.       }
  42.    }
  43.  
  44. define can_image_texture
  45. texture {
  46.    special surface {
  47.       color cylindrical_imagemap(ball_image, P, 1)
  48.       ambient 0.2
  49.       diffuse 0.8
  50.       transmission 0, 1
  51.       }
  52.    }
  53.  
  54. define basic_box object { box <-2, 0, -2>, <2, 1, 2> }
  55.  
  56. basic_box {
  57.    box_image_texture { scale <2, 1, 2> }
  58.    rotate <-30, 30, 0>
  59.    translate <1, 0, -1>
  60.    }
  61.  
  62. object {
  63.    sphere <0, 0, 0>, 1
  64.    ball_image_texture
  65.    rotate <30, 45, 0>
  66.    translate <0, 3, 0>
  67.    }
  68.  
  69. object {
  70.    cylinder <0, 0, 0>, <0, 3, 0>, 1
  71.    can_image_texture { rotate <0, 180, 0> } // { scale <1, 3, 1> }
  72.    translate <-3, 0, 1>
  73.    }
  74.  
  75. // Create a ground plane
  76. object {
  77.    disc <0, -0.001, 0>, <0, 1, 0>, 0, 1000
  78.    texture { checker matte_white, matte_black }
  79.    scale <10, 10, 10>
  80.    translate <0,-0.01,0>
  81.    }
  82.