home *** CD-ROM | disk | FTP | other *** search
/ PC World 2000 May / PCWorld_2000-05_cd.bin / Software / TemaCD / povray / povwin3.exe / %MAINDIR% / scenes / fileio / fileio.pov
Encoding:
Text File  |  2000-04-06  |  1.1 KB  |  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.