Draw3d.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Bloomenthal, April 9, 1986 2:54:44 pm PST
DIRECTORY Draw2d, Imager, Rope, Matrix3d, Spline3d, Vector3d;
Draw3d: CEDAR DEFINITIONS
~ BEGIN
Context:  TYPE ~ Imager.Context;
Triple:  TYPE ~ Vector3d.Triple;
Matrix:  TYPE ~ Matrix3d.Matrix;
In the following procedures, if the matrix is found to have perspective the
transformed points are clipped against the viewing frustum.
Mark: PROC [p: Triple, context: Context, m: Matrix, type: Draw2d.MarkType ← cross, label: Rope.ROPENIL];
Mark transformed p, with optional label; type is one of {cross, x, asterisk, dot, none}.
PP: PROC [p0, p1: Triple, c: Context, m: Matrix, type: Draw2d.DrawType ← solid];
Draw segment p0p1; type is one of {solid, dash, dot}.
PV: PUBLIC PROC [p, v: Triple, label: Rope.ROPENIL, context: Context, m: Matrix, mark: Draw2d.MarkType ← none, scale: REAL ← 0.2];
Draw and label vector v based at point p.
Mark point p with specified type (one of {cross, x, asterisk, dot, none}..
V: PROC [v: Triple, name: Rope.ROPENIL, context: Context, m: Matrix];
Draw and label triple.
Axes: PROC [context: Context, m: Matrix];
Draw the coordinate axes.
The following procedures are for drawing three-dimensional splines.
DrawCurve: PROC [c: Spline3d.Coeffs, context: Context, m: Matrix ← NIL];
Draw the curve on the given context, first transforming the curve if m is non-nil; the number of curve segments is determined by Lane's formula.
DotCurve: PROC [c: Spline3d.Coeffs, context: Context, m: Matrix ← NIL];
Draw the curve on the given context as above but as a series of dots.
DrawBezierPolygon: PROC [b: Spline3d.Bezier, context: Context, m: Matrix ← NIL, type: Draw2d.DrawType ← solid, close: BOOLFALSE];
Draw the traditional three sides of the Bezier polygon; if close is true, draw the fourth side.
type is one of {solid, dash, dot}.
END.