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

  1. // Persistence Of Vision raytracer version 3.0 sample file.
  2. // This scenes shows how to do shear with the matrix transformation.
  3.  
  4.  
  5. #version 3.0
  6. global_settings { assumed_gamma 2.2 }
  7.  
  8. #include "colors.inc"
  9.  
  10. #declare Col1 = -5
  11. #declare Col2 =  0
  12. #declare Col3 =  5
  13.  
  14. #declare Row1 =  -4
  15. #declare Row2 =   4
  16.  
  17. camera {
  18.   orthographic
  19.   location <25, 25, -50>
  20.   right 15*4/3*x
  21.   up 15*y
  22.   look_at  <0, 0, 0>
  23. }
  24.  
  25. light_source { <200, 200, -200> color rgb <1,1,1> }
  26.  
  27. //
  28. // Use aloved famous raytrace green/yellow checkered wall
  29. //
  30.  
  31. plane { z, 2
  32.    pigment {
  33.       checker colour Yellow colour Green
  34.       scale 2
  35.    }
  36.    finish {
  37.       ambient 0.2
  38.       diffuse 0.8
  39.    }
  40. }
  41.  
  42. //
  43. // Declare object to use.
  44. //
  45.  
  46. #declare Thing = box { -1, 1 pigment { color Red } }
  47. //#declare Thing = sphere { 0, 1 pigment { color Red } }
  48. //#declare Thing = cylinder { -y, y, 1 pigment { color Red } }
  49. //#declare Thing = torus { 1, 0.2 pigment { color Red } }
  50. /*
  51. #declare Thing = blob {
  52.     threshold 0.6
  53.     component 1.0, 1.0, <.75,     0,     0>
  54.     component 1.0, 1.0, <-.375,  .64952, 0>
  55.     component 1.0, 1.0, <-.375, -.64952, 0>
  56.     pigment { color Red }
  57. }
  58. */
  59.  
  60. //
  61. // Place original object.
  62. //
  63.  
  64. object { Thing }
  65.  
  66. //
  67. // Place several sheared objects.
  68. //
  69.  
  70. // Shear in positive x direction
  71. object { Thing 
  72.   matrix <    1,     0,  0,   
  73.               1,     1,  0,    
  74.               0,     0,  1,    
  75.            Col1,  Row1,  0 >
  76. }
  77.  
  78. // Shear in positive y direction
  79. object { Thing 
  80.   matrix <    1,     1,  0,   
  81.               0,     1,  0,    
  82.               0,     0,  1,    
  83.            Col2,  Row1,  0 >
  84. }
  85.  
  86. // Shear in positive z direction
  87. object { Thing 
  88.   matrix <    1,     0,  0,
  89.               0,     1,  0, 
  90.               1,     0,  1, 
  91.            Col3,  Row1,  0 >
  92. }
  93.  
  94. // Shear in negative x direction
  95. object { Thing 
  96.   matrix <    1,     0,  0,   
  97.              -1,     1,  0,    
  98.               0,     0,  1,    
  99.            Col1,  Row2,  0 >
  100. }
  101.  
  102. // Shear in negative y direction
  103. object { Thing 
  104.   matrix <    1,    -1,  0,   
  105.               0,     1,  0,    
  106.               0,     0,  1,    
  107.            Col2,  Row2,  0 >
  108. }
  109.  
  110. // Shear in negative z direction
  111. object { Thing 
  112.   matrix <    1,     0,  0,
  113.               0,     1,  0, 
  114.              -1,     0,  1, 
  115.            Col3,  Row2,  0 >
  116. }
  117.  
  118.