Previous: clpl2 Up: ../plot79_c.html Next: clpl4
SUBROUTINE CLPL3 (P1,P2,BOUND,CLIP,MOVED1,MOVED2,REJECT,
X ALPHA1,ALPHA2)
C$ (3-Dimensional Line-Segment Clip)
C$ Clip a line segment defined by its endpoints in
C$ 4-dimensional homogeneous coordinates to given boundaries.
C$ Clipping may be requested against any of the 6 viewing
C$ pyramid faces. This version assumes that both points have
C$ their fourth coordinate, H, equal to 1. The arguments are:
C$
C$ P1(*)..........(X,Y,Z,H) coordinates of first point.
C$ P2(*)..........(X,Y,Z,H) coordinates of second point.
C$ BOUND(*).......Array containing the 6 clipping limits in the
C$ order: Left, Right, Bottom, Top, Near, Far.
C$ CLIP(*)........LOGICAL array set .TRUE. in CLIP(K) if the
C$ K-th bound is to be clipped against.
C$ MOVED1.........LOGICAL value set .TRUE. if point 1 is moved.
C$ MOVED2.........LOGICAL value set .TRUE. if point 2 is moved.
C$ REJECT.........LOGICAL value set .TRUE. if the segment is
C$ rejected (i.e. invisible). If the line
C$ is rejected, ALPHA1 and ALPHA2 will be
C$ unchanged on return.
C$ ALPHA1.........Parameter alpha for the first point in the
C$ parametric line representation
C$ (1-alpha)*P1 + alpha*P2.
C$ ALPHA2.........Parameter alpha for the second point.
C$
C$ ALPHA1 and ALPHA2 must have valid values on input (e.g. 0.0
C$ and 1.0), and will only be updated if MOVED1 or MOVED2 is
C$ set .TRUE. respectively. P1(*) and P2(*) are ***NEVER***
C$ modified; the clipped line segment is defined solely in
C$ terms of the alpha's. REJECT is also assumed to have a
C$ value on entry, and return will occur immediately if it is
C$ .TRUE.
C$
C$ Author: John Halleck, University of Utah Computing Center,
C$ Salt Lake City, Utah 84112, USA
C$ (02-JAN-88)