**************************************************************************
**************************************************************************
         MESH OF ROTATION FOR PERSISTENCE OF VISION 3.1x
**************************************************************************
**************************************************************************

Created by Uwe Zimmermann, Stockholm, Sweden 1999

1.0  INSTALLATION
2.0  INTRODUCTION
3.0  DESCRIPTION OF THE MACROS
4.0  CONTACTING THE AUTHOR

**************************************************************************


1.0  INSTALLATION
**************************************************************************
Just copy the POVRay include file "mor.inc" into one of the 
directories (folders) in your POVRay library path or the path of 
your POVRay main scene file.  


2.0  INTRODUCTION
**************************************************************************
The macro defined in the include file "mor.inc" allows you to create
an object quite similar to the SOR (surface of rotation) or lathe
object already defined in POV-Ray. So why do we need a third macro of this
kind? 
I just encountered the problems that sooner or later most POV-Users encounter
when using the SOR object - at least there have been a lot of reports about a
certain "own free will" of SOR objects when it comes to closed ends and not
disintegrating shapes.
See below for the differences!
  

3.0  DESCRIPTION OF THE MACROS
**************************************************************************

   #macro mesh_of_rotation(points, angular_range, division, smoothing, closed)
                                                              
        The macro returns a MESH derived from the rotation of an array of 
        uv-vectors 'points' for the given 'angular_range' degrees around 
        the y-axis. It is similar to the original SOR (surface of rotation) 
        object of POV_Ray except for the following:
           - renders error free in POV_Ray 3.1g
           - allows the intersection of the 2D-curve defined by 'points' with itself.
           
        The u component of the 'points' vectors gives the distance from the 
        y-axis while the v component gives the length along this axis.
        The number given by the parameter 'division' gives the number 
        of angular steps for the angular range one full rotation.  
        The parameter 'smoothing' allows surface smoothing by the use 
        of 'smooth_triangle' (smoothing=1) instead of 'triangle' (smoothing=0). 
        The normal vector for each point on the definition curve is derived 
        from its two neighbours. In any case, with or without smoothing, the first 
        AND last point in the array points is NOT on the surface of the mesh. 
        It is only used to derive the surface normal of the second and second 
        last point - thus the minimum size of the array 'points' is 4 (four) 
        uv-vectors.
        The parameter 'closed' closes the "top" and "bottom" end of the figure 
        with a plane. As this is derived from the second and second-last point 
        in the list of points, it is not necessarily the real bottom and top: 
        Remember that the curve is allowed to intersect itself!
        
   #macro union_of_rotation(points, angular_range, division, smoothing, closed)
        
        essentially the same macro as the above given 'mesh_of_revolution'
        but it returns a union of the face objects instead of a triangular mesh. 
        Thus it is possible to use different objects on the faces than just 
        triangles.

Another feature of this macro is the following: by defining a macro named 
'mor_do_face' with the following parameters:

   #macro mor_do_face (corner_1, corner_2, corner_3, corner_3)
   
your own drawing routine is called for every face triangle of the structure


4.0  CONTACTING THE AUTHOR
**************************************************************************
If you wish to contact me with bug reports, bug fixes, criticisms, 
comments, suggested improvements, questions, etc. you can reach me by 
email at:

   uwezi@geocities.com

or by regular mail at:

   Uwe Zimmermann
   Dept. of Electronics
   Royal Institute of Technology
   Electrum 229
   S-16440 Stockholm
   Sweden
                         
http://www.geocities.com/SiliconValley/Lakes/5432/povray                         
                         
**************************************************************************

POV-Ray(tm) and Persistence of Vision(tm) are registered trademarks of the
POV-Ray Team(tm)
