DIRECTORY G3dRender; G3dShadeClipXfm: CEDAR DEFINITIONS ~ BEGIN Pixel: TYPE ~ G3dRender.Pixel; -- [ r, g, b, a, z: CARDINAL] Triple: TYPE ~ G3dRender.Triple; -- [ x, y, z: REAL]; RGB: TYPE ~ G3dRender.RGB; Matrix: TYPE ~ G3dRender.Matrix; OutCode: TYPE ~ G3dRender.OutCode; ClipState: TYPE ~ G3dRender.ClipState; Context: TYPE ~ G3dRender.Context; CtlPointSequence: TYPE ~ G3dRender.CtlPointSequence; Shape: TYPE ~ G3dRender.Shape; ShadingSequence: TYPE ~ G3dRender.ShadingSequence; FacingDir: TYPE ~ G3dRender.FacingDir; CtlPtInfo: TYPE ~ G3dRender.CtlPtInfo; Patch: TYPE ~ G3dRender.Patch; PatchSequence: TYPE ~ G3dRender.PatchSequence; GetCtlPtInfo: PROC RETURNS [REF CtlPtInfo]; ReleaseCtlPtInfo: PROC [vtx: REF CtlPtInfo]; GetPatch: PROC [size: NAT] RETURNS [REF Patch]; ReleasePatch: PROC [p: REF Patch]; GetPolyNmls: PUBLIC PROC[context: Context, shape: Shape]; GetVtxNmls: PROC [context: Context, shape: Shape]; ClipBoundingSphere: PROC[context: Context, shape: Shape, xfm: Matrix] RETURNS[G3dRender.ClipState]; ClipPoly: PROC [context: Context, poly: REF Patch] RETURNS [REF Patch]; GetPatchClipState: PROC[ patch: REF Patch]; GetClipCodeForPt: PROC [context: Context, pt: Triple] RETURNS [clip: OutCode]; XfmPtToEyeSpace: PROC [context: Context, pt: Triple, xfm: Matrix _ NIL] RETURNS [Triple, OutCode]; XfmPtToDisplay: PROC [context: Context, pt: Triple, shape: Shape _ NIL] RETURNS [Triple]; RegisterStandardSurface: PROC [context: Context, type: ATOM]; BackFacing: PROC [context: Context, poly: REF Patch, useEyeSpace: BOOL _ FALSE] RETURNS [FacingDir]; ShadePoly: PROC [context: Context, poly: REF Patch]; END. 4G3dShadeClipXfm.mesa Copyright c 1984 by Xerox Corporation. All rights reserved. Last Edited by: Crow, May 16, 1989 3:03:48 pm PDT Basic Types Patch Definitions RECORD [ type: ATOM _ NIL, oneSided: BOOL _ TRUE, nVtces: NAT _ 0, clipState: ClipState _ unknown, dir: FacingDir _ unknown, props: PropList _ NIL, ctlPt: SEQUENCE maxLength: NAT OF CtlPtInfo ]; RECORD [SEQUENCE length: CARDINAL OF REF Patch]; Caching Procedures Gets vertex from automatically expanding pool. Returns vertex to pool. Gets patch from automatically expanding pool. Returns patch to pool. Procedures for Derived Data for Shapes Calculate normals for all polygons in shape. Sum normals for vertices given by adjacent polygon corners, only for polygons! Procedures for Transformations and Clipping Clips one polygon (or polyline) to current state of context. Gets clips state (in, out, clipped) for one patch Evaluates clip codes for vertices (for easy acceptance and rejection tests). Transforms triple from object space to eyespace. Transforms triple from eyespace to display coordinates. Procedures for expansion of/to polygons Procedures for Shading Patches Tests if polygon faces away from viewer, thus on back side of object. ΚR˜™Jšœ Οmœ1™