home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format 38 / af038a.adf / Advanced_Util / ThreeDPlot / ThreeDPlot.doc < prev   
Text File  |  1992-07-09  |  5KB  |  130 lines

  1. **************************************************************************
  2.  
  3.     THIS SOFTWARE IS IN THE PUBLIC DOMAIN.  IT IS INTENDED TO
  4.     BE AVAILABLE FREE TO ANYONE WHO WANTS IT.  YOU MAY USE AND
  5.     DISTRIBUTE IT AS YOU LIKE WITH THE FOLLOWING RESTRICTIONS:
  6.  
  7.     1)  You may not sell this software or charge more than a
  8.         small copying/hassle fee for distributing it.
  9.  
  10.     2)  You may not remove this notice from the distribution.
  11.  
  12.         Tim Mooney
  13.         5904 Vandegrift Ave.
  14.         Rockville, MD 20851
  15.  
  16. ****************************************************************************
  17.  
  18.     ThreeDPlot - 3-D DATA PLOTTING ROUTINE
  19.    
  20.       ThreeDPlot displays the projection on the screen of a function z(x,y).
  21.    The function must be single-valued, and defined on an x-y grid.
  22.  
  23. ------------------------------------------------------------------------
  24.  
  25.       To get a quick idea of what is going on here, drop a net over a
  26.    chessboard in the middle of a game: the heights of the various pieces
  27.    are the z coordinates; the positions (row, column) of the pieces are
  28.    the (x, y) coordinates.  ThreeDPlot draws a picture of the net.
  29.    
  30.       Continuing with the chessboard analogy: ThreeDPlot first wants to know
  31.    how many rows (let's call this number "NROWS") and columns ("NCOLS") of
  32.    data to expect.  Then it wants the row coordinates (NROWS of them); then
  33.    the column coordinates; and finally the z coordinates, starting with the
  34.    row nearest you, from left to right, to the row nearest your opponent.
  35.    Further, ThreeDPlot wants all of this in a binary file: 4-byte-int
  36.    (# rows); 4-byte-int (# columns); 4-byte-floats (z coordinates).
  37.    ThreeDPlot does NOT want x or y coordinates in the data file.  (The
  38.    program dat_2_bin exists to convert a text file of x, y, and z data to
  39.    a binary file ThreeDPlot will plot.  See notes below on dat_2_bin.)
  40.    
  41.       You tell ThreeDPlot from what viewing point you wants to see the net.
  42.    Imagine looking at the board "edge-on" -- your eyes level with the
  43.    table -- and facing your opponent.  ThreeDPlot calls this position
  44.    "phi = 0 degrees, theta = 0 degrees".  If you rotate the board clock-
  45.    wise (as seen from above) on the table, you are increasing phi to some
  46.    positive value.  Now with phi fixed, tilt the table toward you so that
  47.    the pieces would fall in your lap.  To ThreeDPlot, this decreases theta
  48.    to some negative angle;  it gives you a view of the top of the board.
  49.  
  50.       ThreeDPlot uses a very simple algorithm for hidden-line removal: lines
  51.    are plotted from the bottom of the screen up; for each possible horizontal
  52.    position, a record is kept of the topmost point plotted so far.  This
  53.    algorithm is suitable for binned data, chessboards viewed from above,
  54.    and the like.  A command line option ("-2") allows a "bottom view " of
  55.    the data set to be displayed also;  the same algorithm is used in reverse.
  56.    
  57. *************************************************************************
  58. There are two menus, PROJECT and OPTIONS:
  59.  
  60. *******
  61. PROJECT
  62.  
  63. Open           not implemented
  64.  
  65. Make PltFile   ThreeDPlot will write a file which can be sent ("Copy
  66.                myplotfile TO ser:") to any plotter that understands HPGL, the
  67.                Hewlett Packard Graphics Language. Commands in the plot file
  68.                instruct the (serial interface) plotter to use xON/xOFF.
  69.  
  70. Make TxtFile   ThreeDPlot will write a file that can be converted into an
  71.                IntroCAD drawing.  The program txt_2_icad does this
  72.                conversion.
  73.  
  74. Quit           Quits to CLI.
  75.  
  76.  
  77. *******
  78. OPTIONS  (all are toggles)
  79.  
  80. BothSides      Draws top and bottom sides of data
  81.  
  82. Axes           Toggles axes.
  83.  
  84. NegImage       Swap background and foreground colors.
  85.  
  86. Net Plot       Toggle between crosshatch plot and simpler line plot
  87.  
  88.  
  89.  
  90. *************************************************************************
  91.    Also, ThreeDPlot reads the keyboard -- specifically, the arrow keys and
  92. the numbers 1-9 on the numeric keypad.  Pressing one of these causes a replot
  93. with one or both viewing angles changed by 10 degrees.  The action of some
  94. of these keys is counter-intuitive if theta is greater than 180 degrees.
  95.  
  96. *************************************************************************
  97. dat_2_bin
  98.     dat_2_bin reads a text file and makes a binary file that ThreeDPlot
  99. can read.  (It takes a relatively long time to do this.  The read/convert
  100. step has been taken out of ThreeDPlot and made into a separate program for
  101. this reason.)
  102.  
  103.     dat_2_bin wants a file with the following format:
  104.  
  105. NX NY    !MUST be on first line of file
  106. x[1]    !Anything may follow a number on a line.  All but the number will
  107. x[2]    !be ignored.
  108. x[3]
  109.  .
  110.  .
  111.  .
  112. x[NX]
  113. y[1]
  114. y[2]
  115. y[3]
  116.  .
  117.  .
  118.  .
  119. y[NY]
  120. z[1]
  121. z[2]
  122. z[3]
  123.  .
  124.  .
  125.  .
  126. z[NX*NY]
  127. end-of-file
  128.  
  129.  
  130.