DIRECTORY Atom USING [PropList], Rope USING [ROPE], IO USING [STREAM], Vector2 USING [VEC], ScanConvert USING [RealSequence], Linear3d USING [Triple, Quad], ThreeDScenes USING [AllOut, ClipState, Context, NoneOut, OutCode, ShapeInstance, ShapeSequence, Vertex, VertexInfo]; ThreeDPolygons: CEDAR DEFINITIONS ~ BEGIN ThreeDPolygonsError: SIGNAL [reason: ATOM]; Pair: TYPE ~ Vector2.VEC; -- [ x, y: REAL]; Triple: TYPE ~ Linear3d.Triple; -- [ x, y, z: REAL]; Quad: TYPE ~ Linear3d.Quad; -- [ x, y, z, w: REAL]; RealSequence: TYPE ~ ScanConvert.RealSequence; OutCode: TYPE ~ ThreeDScenes.OutCode; NoneOut: OutCode ~ ThreeDScenes.NoneOut; AllOut: OutCode ~ ThreeDScenes.AllOut; Vertex: TYPE ~ ThreeDScenes.Vertex; VertexInfo: TYPE ~ ThreeDScenes.VertexInfo; Polygon: TYPE ~ RECORD[nVtces: NAT, clipState: ClipState, props: Atom.PropList, vtx: SEQUENCE length: NAT OF VertexInfo]; PolygonSequence: TYPE ~ RECORD [SEQUENCE length: NAT OF REF Polygon]; PtrPoly: TYPE ~ RECORD[nVtces: NAT, clipState: ClipState, props: Atom.PropList, vtxPtr: SEQUENCE length: NAT OF NAT]; PtrPolySequence: TYPE ~ RECORD[SEQUENCE length: NAT OF REF PtrPoly]; ShapePolygon: TYPE ~ RECORD[shape: REF ShapeInstance, polygon, next: NAT]; SortSequence: TYPE ~ RECORD[SEQUENCE length: NAT OF ShapePolygon]; ClipState: TYPE ~ ThreeDScenes.ClipState; ShapeInstance: TYPE ~ ThreeDScenes.ShapeInstance; EnableDisplay: PROC []; StopDisplay: PROC []; LoadShape: PROC[shape: REF ShapeInstance, fileName: Rope.ROPE, type: ATOM _ $Polyhedron]; ReadPolygons: PROC[shape: REF ShapeInstance, in: IO.STREAM, nPolys: NAT]; GetPolygonColors: PROC[shape: REF ShapeInstance, fileName: Rope.ROPE]; ClipPoly: PROC[ context: REF ThreeDScenes.Context, shape: REF ShapeInstance, poly, poly2: REF Polygon] RETURNS [REF Polygon, REF Polygon]; BackFacing: PROC[ poly: REF Polygon] RETURNS [BOOLEAN]; ShadePoly: PROC[ context: REF ThreeDScenes.Context, poly: REF Polygon]; GetShades: PROC[context: REF ThreeDScenes.Context, shape: REF ShapeInstance]; GetPolyNormals: PROC[shape: REF ShapeInstance]; GetVtxNormals: PROC[shape: REF ShapeInstance]; LoadSortSequence: PROC[ context: REF ThreeDScenes.Context, buckets: REF ThreeDPolygons.SortSequence _ NIL ] RETURNS[REF SortSequence]; DoBackToFront: PROC[ context: REF ThreeDScenes.Context, sortSeq: REF SortSequence, action: PROC[ShapePolygon]]; DoFrontToBack: PROC[ context: REF ThreeDScenes.Context, sortSeq: REF SortSequence, action: PROC[ShapePolygon]]; DoForPolygons: PROC[set: REF ThreeDScenes.ShapeSequence, action1: PROC[ShapePolygon], action2: PROC[REF ThreeDScenes.ShapeInstance]]; ShowObjects: PROC[ context: REF ThreeDScenes.Context, frontToBack: BOOLEAN _ FALSE ]; ShowWireFrameObjects: PROC[context: REF ThreeDScenes.Context]; OutputLines: PROC[context: REF ThreeDScenes.Context, p: ShapePolygon]; OutputPoly: PROC[context: REF ThreeDScenes.Context, p: ShapePolygon]; END. "ThreeDPolygons.mesa Copyright c 1984 by Xerox Corporation. All rights reserved. Last Edited by: Crow, January 22, 1986 12:19:19 pm PST Basic Types Vertex Definitions Polygon Definitions Shape Definitions Utility Procedures Procedures for Reading in Shape Descriptions Procedures for Transformations and Clipping Procedures for Shading Procedures for Sorting and Display This builds a back-to-front ordered sequence of polygon references These call a procedure for each polygon in a set of objects These scan convert an individual polygon Κ$˜Iheadšœ™šœ Οmœ1™J™(—Jš‘ œžœ žœ(˜FJš‘ œžœ žœ(˜E—Nšžœ˜J˜—…— Κ