home *** CD-ROM | disk | FTP | other *** search
/ ANews 3 / AnewsCD3.iso / atari / GRAPHX / POV / 68030.060 / POV31G30 / POVRAY_3.1G / INCLUDE / SHAPES.INC < prev    next >
Text File  |  1999-10-30  |  4KB  |  155 lines

  1. #ifdef(Shapes_Inc_Temp)
  2. // do nothing
  3. #else
  4. #declare Shapes_Inc_Temp = version;
  5.  
  6. #ifdef(View_POV_Include_Stack)
  7. #   debug "including shapes.inc\n"
  8. #end
  9.  
  10. /*
  11.               Persistence of Vision Raytracer Version 3.1
  12.  
  13.                                IMPORTANT!
  14.    This collection of standard shapes has been around since the days
  15.    of DKB-Trace and early versions of POV-Ray.  Those versions had no
  16. optomized primatives for planes, cones, disks etc.  Some of the definitions
  17.   below may seem trivial or unnecessary given the POV-Ray 2.0 and higher
  18.  object primatives.  We have retained these objects for compatibility with
  19.                            earlier versions.
  20.  
  21.  With the release of POV-Ray 1.0, some of these shapes, in particular,
  22. the "Disk_?" group, were changed from an earlier beta test and DKB-Trace
  23.    style.  The file "shapes.old" is also included in this package for
  24.                    compatibility with pre-1.0 scenes.
  25.  
  26. */
  27.  
  28.  
  29. #declare Ellipsoid =
  30.  sphere {<0, 0, 0>,1}
  31.  
  32. #declare Sphere =
  33.  sphere {<0, 0, 0>,1}
  34.  
  35. #declare Cylinder_X =
  36.  quadric
  37.   {<0, 1, 1>,
  38.    <0, 0, 0>,
  39.    <0, 0, 0>, -1
  40.   }
  41.  
  42. #declare Cylinder_Y =
  43.  quadric
  44.   {<1, 0, 1>,
  45.    <0, 0, 0>,
  46.    <0, 0, 0>, -1
  47.   }
  48.  
  49. #declare Cylinder_Z =
  50.  quadric
  51.   {<1, 1, 0>,
  52.    <0, 0, 0>,
  53.    <0, 0, 0>, -1
  54.   }
  55.  
  56. // Infinite cones
  57. #declare QCone_X =
  58.  quadric
  59.   {<-1, 1, 1>,
  60.    < 0, 0, 0>,
  61.    < 0, 0, 0>, 0
  62.   }
  63.  
  64. #declare QCone_Y =
  65.  quadric
  66.   {<1, -1, 1>,
  67.    <0, 0, 0>,
  68.    <0, 0, 0>, 0
  69.   }
  70.  
  71. #declare QCone_Z =
  72.  quadric
  73.   {<1, 1, -1>,
  74.    <0, 0, 0>,
  75.    <0, 0, 0>, 0
  76.   }
  77.  
  78. // Unit cones    
  79. // The Cone_n objects were formerly defined as intersections of
  80. // quadrics and boxes but now can be redefined with the cone primative.
  81.  
  82. #declare Cone_X = cone {x,0,-x,1}
  83. #declare Cone_Y = cone {y,0,-y,1}
  84. #declare Cone_Z = cone {z,0,-z,1}
  85.  
  86. // The Plane_nn objects were formerly defined as quadrics but now can
  87. // be redefined as a plane.
  88.  
  89. #declare Plane_YZ = plane {x,0}
  90. #declare Plane_XZ = plane {y,0}
  91. #declare Plane_XY = plane {z,0}
  92.  
  93. /* y^2 + z^2 - x = 0 */
  94. #declare Paraboloid_X =
  95.  quadric
  96.   {< 0, 1, 1>,
  97.    < 0, 0, 0>,
  98.    <-1, 0, 0>, 0
  99.   }
  100.  
  101. /* x^2 + z^2 - y = 0 */
  102. #declare Paraboloid_Y =
  103.  quadric
  104.   {<1,  0,  1>,
  105.    <0,  0,  0>,
  106.    <0, -1,  0>, 0
  107.   }
  108.  
  109. /* x^2 + y^2 - z = 0 */
  110. #declare Paraboloid_Z =
  111.  quadric
  112.   {<1,  1,  0>,
  113.    <0,  0,  0>,
  114.    <0,  0, -1>, 0
  115.   }
  116.  
  117. /* y - x^2 + z^2 = 0 */
  118. #declare Hyperboloid =
  119.  quadric
  120.   {<-1,  0,  1>,
  121.    < 0,  0,  0>,
  122.    < 0,  1,  0>, 0
  123.   }
  124.  
  125. #declare Hyperboloid_Y =
  126.  quadric                 /* Vertical hyperboloid */
  127.   {<1, -1,  1>,          /*                      */
  128.    <0,  0,  0>,          /*            \   /     */
  129.    <0,  0,  0>, -1       /* Like this:  ) (      */
  130.   }                      /*            /   \     */
  131.  
  132. // Cube using the procedural box primitive
  133. #declare UnitBox = box { <-1, -1, -1>, <1, 1, 1> }
  134.  
  135. // This primitive used to be an intersection of six planes.  For speed,
  136. // it is now a box and nothing else.
  137. #declare Cube = box { <-1, -1, -1>, <1, 1, 1> }
  138.  
  139. // The Disk primitives are "capped" cylinders of unit length.
  140. //
  141. // They are now "unit" size, the same as a sphere with a radius of 1.
  142. // They will now scale evenly in all directions.
  143.  
  144. #declare Disk_X =    /* Capped cylinder, Length in x axis */
  145.  cylinder { x,-x,1}
  146.  
  147. #declare Disk_Y =    /* Capped cylinder, Length in y axis */
  148.  cylinder { y,-y,1}
  149.  
  150. #declare Disk_Z =    /* Capped cylinder, Length in z axis */
  151.  cylinder { z,-z,1}
  152.  
  153. #version Shapes_Inc_Temp;
  154. #end
  155.