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

  1. // Persistence Of Vision Raytracer version 3.1 sample file.
  2. // FLOAT5.POV
  3. // Demonstrates various new float math functions and #while loop
  4.  
  5. global_settings { assumed_gamma 2.2 }
  6.  
  7. #include "colors.inc"
  8.  
  9. #declare Rad=1/6;
  10. #declare Font="cyrvetic.ttf"
  11.  
  12. #declare Xval=-6.0;
  13.  
  14. #while (Xval <= 6.0)
  15.   sphere{<Xval,exp(Xval),0>,Rad pigment{Red}}
  16.  
  17.   #if (Xval != 0.0)
  18.     sphere{<Xval,pow(Xval,-1),0>,Rad pigment{Green}}
  19.   #end
  20.  
  21.   sphere{<Xval,pow(Xval,2),0>,Rad pigment{Blue}}
  22.   sphere{<Xval,pow(Xval,3),0>,Rad pigment{Cyan}}
  23.  
  24.   #if (Xval > 0.0)
  25.     sphere{<Xval,log(Xval),0>,Rad pigment{Magenta}}
  26.   #end
  27.  
  28.   #declare Xval=Xval+0.1;
  29. #end
  30.  
  31.  text{ttf Font "Y=exp(X)",0.1,0    translate <-6.5, 0.5,0> pigment{Red}}
  32.  text{ttf Font "Y=pow(X,-1)",0.1,0 translate <-6.5,-1.5,0> pigment{Green}}
  33.  text{ttf Font "Y=pow(X,2)",0.1,0  translate <-6.5, 3,0>   pigment{Blue}}
  34.  text{ttf Font "Y=pow(X,3)",0.1,0  translate <-6.5,-4,0>   pigment{Cyan}}
  35.  text{ttf Font "Y=log(X)",0.1,0    translate < 2.5, 2,0>   pigment{Magenta}}
  36.  
  37. camera {
  38.    location  <0, 0, -120>
  39.    direction <0, 0,  12>
  40.    look_at   <0, 0,   0>
  41. }
  42.  
  43. light_source { <5000, 10000, -20000> color White}
  44. plane { -z, -Rad pigment {checker color rgb <1,.8,.8> color rgb <1,1,.8>} }
  45.  
  46. union{ // X-axis
  47.  cylinder{-x*5.5,x*5.5,.1}
  48.  cone{-x*6.5,0,-x*5.5,.2}
  49.  cone{ x*6.5,0, x*5.5,.2}
  50.  translate z*Rad
  51.  pigment{rgb<1,.8,1>}
  52. }
  53.  
  54. union{ // Y-axis
  55.  cylinder{-y*4,y*4,.1}
  56.  cone{-y*5,0,-y*4,.2}
  57.  cone{ y*5,0, y*4,.2}
  58.  translate z*Rad
  59.  pigment{rgb<.8,1,1>}
  60. }
  61.  
  62. union{ // Axes labels
  63.  text{ttf Font "X",0.1,0 translate <5.5,-1,0>}
  64.  text{ttf Font "Y",0.1,0 translate <-.75,4,0>}
  65.  pigment{rgb<1,.4,0>}
  66. }
  67.  
  68.