home *** CD-ROM | disk | FTP | other *** search
/ ANews 3 / AnewsCD3.iso / atari / GRAPHX / POV / 68030.060 / POV31G30 / POVRAY_3.1G / SCENES / FILEIO / FILEIO.POV
Text File  |  1999-10-30  |  1KB  |  42 lines

  1. // Persistence of Vision Ray Tracer POV-Ray 3.1 Sample Scene
  2. // by Chris Young
  3. // FILEIO.POV demonstrates basic use of fopen, read and write directives.  
  4. // A string, float and vector are written to a file, read back in
  5. // and displayed.
  6.  
  7. #include "colors.inc"
  8.  
  9. light_source { <100,1000,-1000>, White}
  10.  
  11. camera { location <0,1,-16> direction 2*z look_at <0,1,0>}
  12.  
  13. #fopen MyFile "FILEIO.TXT" write 
  14.  
  15. #write (MyFile,"\"Testing 123\",",5,",",<1,2,3>,"\n")
  16.  
  17. #fclose MyFile
  18.  
  19. #fopen MyFile "FILEIO.TXT" read
  20.  
  21. #read (MyFile,MyString,MyFloat,MyVect)
  22.  
  23. #fclose MyFile
  24.  
  25. union{
  26.  text{ttf "timrom.ttf" concat("MyString='",MyString,"'"),0.1,0 translate y}
  27.  text{ttf "timrom.ttf" concat("MyFloat=",str(MyFloat,0,0)),0.1,0 }
  28.  text{ttf "timrom.ttf" concat("MyVector=<",
  29.                                str(MyVect.x,0,0),",",
  30.                                str(MyVect.y,0,0),",",
  31.                                str(MyVect.z,0,0),">"),0.1,0 translate -y}
  32.  
  33.  pigment{Red}
  34.  translate -5*x
  35. }
  36.  
  37. union { 
  38.  plane{y,-2} plane{-z,-10} plane{x,-10}
  39.  pigment{checker Cyan,Yellow}
  40. }
  41.  
  42.