home *** CD-ROM | disk | FTP | other *** search
/ ANews 3 / AnewsCD3.iso / atari / GRAPHX / POV / 68030.060 / POV31G30 / POVRAY_3.1G / SCENES / ARRAYS / ARRAY1.POV next >
Text File  |  1999-10-30  |  873b  |  40 lines

  1. // Persistence of Vision Ray Tracer POV-Ray 3.1 Sample Scene
  2. // by Chris Young
  3. // ARRAY1.POV demonstrates basic use of an array.  A one dimension
  4. // array is filled with 10 text objects that are a random digit.
  5. // These objects are displayed in a union object in reverse order.
  6.  
  7. #include "debug.inc"
  8. #include "colors.inc"
  9.  
  10. light_source { <100,1000,-1000>, White}
  11.  
  12. camera { location <2,1,-10> direction 2*z look_at <0,0,0>}
  13.  
  14. union { 
  15.  plane{y,-2} plane{-z,-10} plane{x,-10}
  16.  pigment{checker Cyan,Yellow}
  17. }
  18.  
  19. #declare Digit=array[10]
  20.  
  21. #declare S=seed(123);
  22.  
  23. #declare I=0;
  24.  
  25. #while (I<=9)
  26.   #declare Digit[I]=text{ttf "cyrvetic.ttf",str(I,1,0),0.1,0}
  27.   #declare I=I+1;
  28. #end
  29.  
  30. union{
  31.  #declare I=9;
  32.  #while (I>=0)
  33.   #declare D=int(rand(S)*10);
  34.   object{Digit[D] translate x*I*0.6}
  35.   #declare I=I-1;
  36.  #end
  37.  pigment{Red}
  38.  translate <-3,0,0>
  39. }
  40.