Previous: hznbo Up: ../plot79_h.html Next: hzngv


HZNCV

       SUBROUTINE  HZNCV (Z0, Z1,ZE,Z2, MX,MY, NX,NY, LX,LY,  S,
      X                   SOUTH, EAST, TOP, TILT, INTERP, PL2)
 C$    (Corner View)
 C$    Make  a  hidden-line  drawing  of  a  surface  defined   in
 C$    Cartesian coordinates  on a  uniform grid.   A rather  fast
 C$    algorithm is used to provide orthographic views from any of
 C$    the four corners, with optional tilt of the surface.
 C$
 C$    Z0..........Cutoff value.  Only function values, ZE(I,J),
 C$                above (S .GT. 0.0) or  below (S .LT. 0) Z0  are
 C$                visible.
 C$    ZE(*,*).....Array containing the surface.  ZE(I,J) =
 C$                F(X(I),Y(J)), where X(I) = (I-1)*DX and Y(J) =
 C$                (J-1)*DY both map onto the interval 0..1.
 C$    Z1,Z2.......Span of surface values.
 C$    MX,MY.......Actual declared dimensions of the array ZE(*,*).
 C$    NX,NY.......Sections of ZE(*,*) actually used.
 C$    LX,LY.......Increments  in  X  and  Y  directions (.GT. 0).
 C$                Values of LX  and LY  larger than  1 produce  a
 C$                coarser mesh on the drawing without losing  the
 C$                smoothness of the complete surface.  LX  should
 C$                be an integral divisor of NX-1, and LY of NY-1.
 C$                If this  is not  the  case, the  next  smallest
 C$                value which satisfies this requirement is  used
 C$                internally.  At  present,  LX and  LY  will  be
 C$                adjusted internally to be of equal size.
 C$    S...........=+1.0, graph positive part of function,
 C$                =-1.0, graph negative part of function,
 C$                = 0.0, graph both positive and negative parts.
 C$                If S = 0.0, the cutoff value Z0 has no effect.
 C$    SOUTH....... .TRUE. - View from southern edge.
 C$                .FALSE. - View from northern edge.
 C$    EAST........ .TRUE. - View from eastern edge.
 C$                .FALSE. - View from western edge.
 C$    TOP......... .TRUE. - Show top of surface.
 C$                .FALSE. - Show bottom of surface.
 C$                This routine should be called twice, once  with
 C$                each value of top.  This allows changing colors
 C$                between calls to help distinguish the sides.
 C$    TILT........Angle  of  tilt in  degrees.   Tilt is positive
 C$                counterclockwise looking  down  the  horizontal
 C$                axis to the origin.  Thus TILT=0.0  corresponds
 C$                to an overhead view looking down the positive Z
 C$                axis toward  the origin,  and gives  a  totally
 C$                uninteresting  display   of   the   X-Y   grid.
 C$                Negative tilt angles  tip the top  part of  the
 C$                rotated surface away  from the observer  around
 C$                the horizontal axis.  TILT=-90.0 corresponds to
 C$                an edge-on  view of  the surface.   Recommended
 C$                values are in the range -20..-70.
 C$    INTERP...... .TRUE. - Interpolate  function  values   using
 C$                          bivariate surface interpolation.
 C$                .FALSE. - Interpolate  function  values   using
 C$                          simple linear interpolation.  This is
 C$                          the  fastest  way,  and  is   usually
 C$                          adequate for grids larger than  about
 C$                          50 by 50.
 C$    PL2.........2-D pen movement subroutine, usually PL2CA
 C$
 C$    The algorithm used here is described by
 C$
 C$    J. Butland, "Surface Drawing  Made Simple", Computer  Aided
 C$    Design, Vol. 11, No. 1 (January, 1979).
 C$
 C$    It was discovered and implemented several years earlier  at
 C$    the Bettis  Atomic Power  Laboratory (pre-1971),  and  then
 C$    improved and rewritten by John Halleck at the University of
 C$    Utah, and the SAFRAS program, as it is called, has received
 C$    extensive use at the  University of Utah Computing  Center.
 C$    The outline sketch idea implemented in this routine appears
 C$    to   be   original   with   J.   Butland,   however.    The
 C$    Bettis/Halleck  version  differs  from  Butland's  in  that
 C$    horizons are computed in left-to-right sweeps, rather  than
 C$    in vertical strips, which necessitates substantially larger
 C$    horizon work areas, but economizes greatly in pen movement.
 C$    Butland's    algorithm     incorporates    cubic     spline
 C$    interpolation, while the Bettis/Halleck version uses linear
 C$    interpolation.  Provided that a sufficiently dense function
 C$    grid is available, the difference in quality is not  great.
 C$
 C$    Because the scan proceeds in strips from front to back, the
 C$    Butland algorithm implemented  here requires a  substantial
 C$    amount of pen movement,  since the pen  must be lifted  and
 C$    moved from back to  front for each  stip.  It is  therefore
 C$    not recommended for  use on incremental  pen plotters,  but
 C$    will perform  quite satisfactorily  on CRT  and  dot-matrix
 C$    displays.
 C$
 C$    (20-JUL-89)