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

  1. // Persistence Of Vision raytracer version 3.0 sample file.
  2. // Texture warp example
  3.  
  4. #version 3
  5. global_settings { assumed_gamma 2.2 }
  6.  
  7. #include "colors.inc"
  8.  
  9. camera { 
  10.   location <0,3,-31>
  11.   direction 3*z
  12.  
  13. plane {  y,-1.01  pigment {checker Yellow,White}}
  14.  
  15. plane {  z, 4.01  pigment {checker Yellow,White}}
  16.  
  17. light_source { <300, 500, -500> color Gray65}
  18. light_source { <-50,  10, -500> color Gray65}
  19.  
  20. #declare Thing = plane{z,0.1 clipped_by{box{-2,2}}}
  21. #declare Test = pigment{image_map{gif "test.gif"} translate -1/2 scale 4}
  22.  
  23. object{Thing
  24.   pigment { Test
  25.  
  26. //This is the traditional non-warp turbulence in the X direction only
  27.     turbulence 0.4*x octaves 2  
  28.  
  29. // followed by a rotate left 90 degrees.  The result is a rotated image
  30. // with the turbulence rotated with it as see in the upper left
  31.     rotate 90*z
  32.   }
  33.   translate <-3,5.5,0>
  34. }
  35.  
  36. object{Thing
  37.   pigment { Test
  38. // Here we rotate first, then do X turbulence.  However the upper
  39. //  right image shows that traditional POV-Ray syntax always transforms
  40. //  the turbulence with the pattern, regardless of the order specified.
  41.  
  42.     rotate 90*z
  43.     turbulence 0.4*x octaves 2
  44.   }
  45.   translate <3,5.5,0>
  46. }
  47.  
  48. object{Thing
  49.   pigment { Test
  50. // Here we do the rotation first
  51.     rotate 90*z
  52.  
  53. // and then do the turbulence in a new warp statement.  The results in the 
  54. // lower left are what we wanted all along.
  55.     warp{turbulence 0.4*x octaves 2}
  56.   }
  57.   translate <-3,1,0>
  58. }
  59.  
  60. object{Thing
  61.   pigment { Test
  62. // This lower right image shows that putting the warp statement first,
  63. //  reverses the order and behaves the same as the upper images.
  64. //  The turbulence is rotated with the pattern.  The results are slightly
  65. //  different than the upper images.  That is because here, the turb happens
  66. //  after the transformations that are inside the declared Test pigment.
  67.     warp{turbulence 0.4*x octaves 2}
  68.     rotate 90*z
  69.   }
  70.   translate <3,1,0>
  71. }
  72.