home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #7 / amigamamagazinepolishissue1998.iso / varia / povray3 / povray3_060 / pov3demo / other / float5.pov < prev    next >
Text File  |  1997-12-12  |  2KB  |  69 lines

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