home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / GCC / GERLIB_DEV08B.LHA / gerlib / libg++ / etc / PlotFile3D / README < prev    next >
Encoding:
Text File  |  1993-12-12  |  4.5 KB  |  118 lines

  1.  
  2. INFO ABOUT PlotFile3D:
  3.  
  4. The `PlotFile3D' class is similar to the `PlotFile' class, except that
  5. it draws 3D pictures using a simple orthogonal projection.  Here are
  6. some features and limitations:
  7.  
  8.     + mono and stereo modes
  9.     + viewport clipping of all lines and curves (but not text)
  10.     - static wireframes only; no real-time rotation or hidden-line removal
  11.  
  12. For the most part, the methods of PlotFile3D are extensions of their
  13. 2D counterparts in PlotFile, with x,y,z arguments substituted for x,y
  14. arguments where appropriate.  Unlike coordinates in the 2D class,
  15. which (by imitation of the standard Unix plot(3) library) are all of
  16. type `int', the coordinates in PlotFile3D are of type double.  As with
  17. the PlotFile class, all user-visible methods return *this.
  18.  
  19. Exceptions to these rules of thumb are listed in the remainder of this
  20. section.
  21.  
  22. Constructor
  23. ===========
  24.  
  25. PlotFile3D(FILE *fp,
  26.            const bool stereo =FALSE,
  27.            const double th =PI/12, const double ph =PI/3)
  28.  
  29.     fp          obtained via fopen() or popen()
  30.     th            elevation of camera above xy plane (in radians)
  31.     ph          rotation of 3D scene about the z axis (in radians)
  32.     stereo      TRUE if you want a pair of stereo images, side by side
  33.  
  34.     Once specified, the camera's location cannot be changed.
  35.  
  36. Specification of picture dimensions
  37. ===================================
  38.  
  39. space(const double x0, const double y0, const double z0
  40.       const double x1, const double y1, const double z1)
  41.  
  42.     These six coordinates specify a box which would bound the picture
  43.     in 3D space.  PlotFile3D uses this to compute a transformation
  44.     that makes the picture fit nicely in the square 2D viewing frame.
  45.  
  46. Shape specifications
  47. ====================
  48.  
  49. The methods arc() and dot(), which are available in the PlotFile
  50. class, are not available in PlotFile3D.
  51.  
  52. The parameter list of circle() is modified to accommodate three
  53. dimensions:
  54.  
  55. circle(const double cx, const double cy, const double cz,
  56.        const double rx, const double ry, const double rz,
  57.        const int points_per_quadrant =10)
  58.  
  59.     cx,cy,cz   specify the center of the circle
  60.     rx,ry,rz   form a vector whose direction is normal to the plane of
  61.                the circle and whose magnitude is its radius
  62.  
  63.     The final optional parameter specifies the number of points to be
  64.     computed in each quadrant.  If (points_per_quadrant == n), then
  65.     the circle that is drawn is a regular (4*n)-gon.
  66.  
  67. Two of the methods in PlotFile3D have no counterpart in PlotFile.  (Yet
  68. more might be added if it seems appropriate to break with the PlotFile
  69. class philosophy of providing a no-frills package that mirrors the
  70. Unix plot(3) package as closely as possible.)  These are:
  71.  
  72. sphere(const double cx, const double cy, const double cz,
  73.        const double rx, const double ry, const double rz,
  74.        const int points_per_quadrant =10)
  75.  
  76.     These arguments are identical to those expected by circle().  The
  77.     circle specified is the equator of the sphere, which is all that
  78.     is needed to specify it completely.
  79.  
  80. home()
  81.  
  82.     Moves the cursor to a location close to the upper left corner of
  83.     the viewing frame.  Is automatically called by the constructor and
  84.     by space() and erase().
  85.  
  86.     This method is useful when plotting on devices which leave a
  87.     visible cursor at the point most recently drawn.  It may also be
  88.     used to place a title label.  It should not be used to specify a
  89.     starting point for a cont() operation since it leaves the 3D
  90.     cursor location undefined.
  91.  
  92. The remaining methods are completely analogous to their 2D
  93. counterparts in the PlotFile class:  move(), cont(), line(), point(),
  94. box(), erase(), linemod(), label().
  95.  
  96.  
  97. When the 3D cursor location is defined
  98. ======================================
  99.  
  100. The cont() and label() methods start drawing at PlotFile3D's internal
  101. notion of the "current" location in three dimensions.  In many
  102. situations, this 3D cursor location is undefined.
  103.  
  104.     * It is UNDEFINED immediately after construction, space() and erase().
  105.     * It is DEFINED immediately after move(), cont(), line() and point().
  106.     * It is UNDEFINED immediately after box(), circle() and sphere()
  107.       because the manner in which such shapes are drawn is
  108.       implementation-dependent.
  109.     * It is UNDEFINED immediately after home() and label() because
  110.       those are fundamentally 2D operations.
  111.     * It is unaffected after linemod().
  112.  
  113. The 3D cursor location must be defined before any cont() operation.
  114. If defined, the 3D cursor location determines the location of any text
  115. drawn by label().
  116.  
  117.  
  118.