Clip3d.mesa
Copyright © 1984 by Xerox Corporation. All rights reserved.
Bloomenthal, May 23, 1986 1:18:19 am PDT
DIRECTORY Matrix3d, Vector3d;
Clip3d: CEDAR DEFINITIONS
~ BEGIN
Pair:  TYPE ~ Vector3d.Pair;
Triple: TYPE ~ Vector3d.Triple;
Quad:  TYPE ~ Vector3d.Quad;
Matrix: TYPE ~ Matrix3d.Matrix;
Clipping operations on projected 3d points
Clipping is performed using the window edge coordinate algorithm (see Newman and Sproull, 2nd edition). The argument m is the transformation matrix (from object to view space).
Clipping is to the viewing frustum: -1.0 <= (x, y, z) <= 1.0; the format ratio is presumed 1.0.
Alphas: PROC [xp0, xp1: Quad] RETURNS [a0, a1: REAL, off: BOOL];
Return the parametric points of intersection of line xp0-xp1 with the viewing frustum.
Frustum: PROC [p0, p1: Triple, m: Matrix] RETURNS [c0, c1: Triple, off: BOOL];
Clip the line defined by the two world-space points p0 and p1 after transformation by m against planes: x=w, x=-w, y=w, y=-w, z=0, and z=w; return c0 and c1 set to the new line view-space endpoints; off is true iff the line is totally clipped.
FrustumH: PROC [xp0, xp1: Quad] RETURNS [c0, c1: Triple, off: BOOL];
Clip the line defined by the two homogeneous points xp0 and xp1.
FrustumD: PROC [xp0, xp1: Quad] RETURNS [c0, c1: Pair, off: BOOL];
As FrustumClipH except returns pairs.
NearH: PROC [q0, q1: Quad] RETURNS [c0, c1: Pair, off: BOOL];
Clip the line segment only at the z=w plane (ie., the eyepoint); thus there is no far clipping and clipping in x and y occurs in Imager.
END.