home *** CD-ROM | disk | FTP | other *** search
/ PC World 2000 May / PCWorld_2000-05_cd.bin / Software / TemaCD / povray / povwin3.exe / %MAINDIR% / scenes / arrays / array2.pov < prev    next >
Encoding:
Text File  |  2000-04-06  |  910 b   |  43 lines

  1. // Persistence of Vision Ray Tracer POV-Ray 3.1 Sample Scene
  2. // by Chris Young
  3. // ARRAY2.POV demonstrates basic use of a two dimension array.  
  4. // A 4 x 10 array is declared and initialized with one digit
  5. // float values. This digits are displayed as 40 text objects.
  6.  
  7. #include "colors.inc"
  8.  
  9. light_source { <100,1000,-1000>, White}
  10.  
  11. camera { location <2,1,-10> direction 2*z look_at <0,0,0>}
  12.  
  13. union { 
  14.  plane{y,-2} plane{-z,-10} plane{x,-10}
  15.  pigment{checker Cyan,Yellow}
  16. }
  17.  
  18. #declare Digit =
  19.  array[4][10]
  20.  { 
  21.    {7,6,7,0,2,1,6,5,5,0},
  22.    {1,2,3,4,5,6,7,8,9,0},
  23.    {0,9,8,7,6,5,4,3,2,1},
  24.    {1,1,2,2,3,3,4,4,5,5}
  25.  }
  26.  
  27.  
  28. union{
  29.  #declare J=0;
  30.  #while (J<4)
  31.    #declare I=0;
  32.    #while (I<10)
  33.       text{ttf "cyrvetic.ttf",str(Digit[J][I],0,0),0.1,0
  34.       translate <I*.6,-J*1,0>}
  35.       #declare I=I+1;
  36.    #end
  37.    #declare J=J+1;
  38.  #end
  39.  pigment{Red}
  40.  translate <-3,1,0>
  41. }
  42.  
  43.