Misc3d.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Bloomenthal, February 26, 1987 7:27:16 pm PST
DIRECTORY Matrix3d, Spline3d, ThreeDBasics, Vector3d;
Misc3d: CEDAR DEFINITIONS
~ BEGIN
Type Declarations
Pair:     TYPE ~ Vector3d.Pair;
Quad:     TYPE ~ Vector3d.Quad;
Triple:    TYPE ~ Vector3d.Triple;
TripleSequence:  TYPE ~ Vector3d.TripleSequence;
TripleSequenceRep: TYPE ~ Vector3d.TripleSequenceRep;
Matrix:    TYPE ~ Matrix3d.Matrix;
Coeffs:    TYPE ~ Spline3d.Coeffs;
NearPair:    TYPE ~ RECORD [point: Pair, alpha: REAL];
NearTriple:   TYPE ~ RECORD [point: Triple, alpha: REAL];
PlaneIntersection: TYPE ~ RECORD [nRoots: NAT ← 0, roots: ARRAY [0..3) OF REAL];
Miscellaneous Procedures
FrontFacing: PROC [vector: Triple, view: Matrix] RETURNS [BOOL];
Return TRUE iff the transformed vector is front-facing (the z component < 0).
This is useful for culling back-facing polygons if the view does not contain perspective.
NearestPair: PROC [p0, p1, q: Pair] RETURNS [NearPair];
Return closest point on 2d line segment p0-p1 to q, and its alpha parameter.
NearestTriple: PROC [p0, p1, q: Triple] RETURNS [NearTriple];
Return closest point on 3d line segment p0-p1 to q, and its alpha parameter.
IntersectSplineWithPlane: PROC [coeffs: Coeffs, plane: Quad] RETURNS [PlaneIntersection];
Return the roots (if any) of the intersection of plane with the spline.
END.