home *** CD-ROM | disk | FTP | other *** search
/ ANews 3 / AnewsCD3.iso / atari / GRAPHX / POV / 68030.060 / POV31G30 / POVRAY_3.1G / SCENES / MACROS / LOCAL.POV < prev    next >
Text File  |  1999-10-30  |  1KB  |  52 lines

  1. // Persistence of Vision Ray Tracer POV-Ray 3.1 Sample Scene
  2. // by Chris Young
  3. // LOCAL.POV demonstrates basic use of a temporary local identifier
  4. // using the #local directive.  Also demonstrates new #undef directive.
  5. // See debug messages after rendering.
  6.  
  7. #include "colors.inc"
  8.  
  9. light_source { <100,1000,-1000>, White}
  10.  
  11. background{rgb 0.4}
  12.  
  13. camera { location -9*z direction 2*z look_at <0,0,0>}
  14.  
  15. #declare Thing = sphere{0,1 pigment{Red}}
  16.  
  17. /* Thing on the left is global */
  18. object{Thing translate -2.5*x}
  19.  
  20.  
  21. // This include file declares a local version of "Thing"
  22. // and leaves it at the origin.  
  23. #include "local.inc"
  24.  
  25.  
  26. /* Now put "Thing" on the right.  You get the original version.*/
  27. object{Thing translate 2.5*x}
  28.  
  29.  
  30. // The file "local.inc" also declares a local
  31. // identifier called "Local_Item" which disapears on exit.
  32.  
  33. #ifdef (Local_Item)
  34.   #debug "Local_Item found\n"
  35. #else
  36.   #debug "Local_Item not found\n"
  37. #end
  38.  
  39. // Now let's get rid of the global Thing
  40.  
  41. #debug "Doing #undef Thing\n"
  42.  
  43. #undef Thing
  44.  
  45. #ifdef (Thing)
  46.   #debug "Thing found\n"
  47. #else
  48.   #debug "Thing not found\n"
  49. #end
  50.  
  51.  
  52.