home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #7 / amigamamagazinepolishissue1998.iso / varia / povray3 / povray3_fpu / pov3demo / anim / float4 / float4.pov < prev   
Text File  |  1997-12-12  |  2KB  |  65 lines

  1. // Persistence Of Vision Raytracer version 3.0 sample file.
  2. // FLOAT4.POV
  3. // Animate this scene with clock values +ki0.0 to +kf1.0
  4. // Demonstrate sqrt, pow, degrees & atan2 as well as Pythagorean Theorm
  5. // using a 3-4-5 triangle and some boxes.
  6.  
  7. #version 3.0
  8. global_settings { assumed_gamma 2.2 }
  9.  
  10. #include "colors.inc"
  11.  
  12. #declare Rad=1/6
  13. #declare Font="cyrvetic.ttf"
  14.  
  15. camera {
  16.    location  <0, 0, -140>
  17.    direction <0, 0,  11>
  18.    look_at   <0, 0,   0>
  19. }
  20.  
  21. light_source { <5000, 10000, -20000> color White}
  22. plane { z, Rad pigment {checker color rgb <1,.8,.8> color rgb <1,1,.8>} }
  23.  
  24. #declare A=4
  25. #declare B=3*clock
  26. #declare C=sqrt(pow(A,2)+pow(B,2))
  27. #declare Angle_b=atan2(B,A)
  28. #declare b_Degrees=degrees(Angle_b)
  29.  
  30. union {
  31.   box{0,<A,-A,1>
  32.     pigment {checker Yellow , Red}
  33.   }
  34.  
  35.   box{0,<B,B,1>
  36.     pigment {checker Yellow , Blue} 
  37.     translate x*A
  38.   }
  39.   box{0,<C,C,1>
  40.     pigment {checker Yellow , Green} 
  41.     rotate z*b_Degrees
  42.   }
  43.  
  44.   intersection{
  45.     box{0,2}
  46.     cylinder{-z,z,2}
  47.     cylinder{-z,z,1.75 inverse}
  48.     translate z*.1
  49.     pigment{Magenta*.7}
  50.   }
  51.  
  52.   text{ttf Font "A=4",0.1,0 translate <1,-5,0> pigment{Red}}
  53.   text{ttf Font concat("B=",str(B,1,2)),0.1,0 translate <4.25,-1.25,0> pigment{Blue}}
  54.   text{ttf Font "C=sqrt(pow(B,2)",0.1,0  translate <-9,2,0> pigment{Green}}
  55.   text{ttf Font "+pow(C,2))",0.1,0  translate <-7,1,0> pigment{Green}}
  56.   text{ttf Font concat("C=",str(C,1,2)),0.1,0 pigment{Green}
  57.        translate (C+0.3)*y 
  58.        rotate z*b_Degrees
  59.       }
  60.   text{ttf Font concat("b=atan2(B,C)=",str(Angle_b,1,2)),0.1,0 translate <-9,-1,0> pigment{Magenta*.7}}
  61.   text{ttf Font concat("degrees(b)=",str(b_Degrees,1,2)),0.1,0 translate <-8.5,-2,0> pigment{Magenta*.7}}
  62.  
  63.   translate x-y
  64. }
  65.