<> <> <> DIRECTORY Rope USING [ ROPE ], IO USING [ STREAM ], Terminal USING [ Virtual ], Imager USING [ Rectangle, Context] , ScanConvert USING [ GetColorProc ], ThreeDBasics USING [ ClipState, Context, OutCode, RGB, ShadingSequence, ShapeInstance, ShapeSequence, Triple, VertexInfo, VertexInfoSequence, VertexSequence, VtxToRealSeqProc ]; ThreeDScenes: CEDAR DEFINITIONS ~ BEGIN <> Error: SIGNAL [reason: ErrorDesc]; ErrorDesc: TYPE ~ RECORD [code: ATOM, explanation: Rope.ROPE]; RGB: TYPE ~ ThreeDBasics.RGB; Triple: TYPE ~ ThreeDBasics.Triple; -- RECORD [ x, y, z: REAL]; OutCode: TYPE ~ ThreeDBasics.OutCode; VertexSequence: TYPE ~ ThreeDBasics.VertexSequence; ShadingSequence: TYPE ~ ThreeDBasics.ShadingSequence; VertexInfo: TYPE ~ ThreeDBasics.VertexInfo; VertexInfoSequence: TYPE ~ ThreeDBasics.VertexInfoSequence; ClipState: TYPE ~ ThreeDBasics.ClipState; ShapeInstance: TYPE ~ ThreeDBasics.ShapeInstance; ShapeSequence: TYPE ~ ThreeDBasics.ShapeSequence; Context: TYPE ~ ThreeDBasics.Context; ShadingProcs: TYPE ~ RECORD [ThreeDBasics.VtxToRealSeqProc, ScanConvert.GetColorProc]; <> << Gets context>> Create: PROC[] RETURNS [REF Context]; << Sets up context.display using imager context >> DisplayFromImagerContext: PROC[ context: REF Context, imagerCtx: Imager.Context ]; << Sets up context.display using virtual terminal, render mode from state of color display>> DisplayFromTerminal: PROC[ context: REF Context, terminal: Terminal.Virtual ]; << Sets up context.display using virtual memory (not visible) full-color assumed >> DisplayFromVM: PROC[ context: REF Context, width, height: NAT, renderMode: ATOM _ $FullColor ]; << Makes depth buffer in VM for context.display>> AddDepthBuffer: PROC[ context: REF Context ]; << Makes alpha buffer in VM for context.display>> AddAlphaBuffer: PROC[ context: REF Context ]; <> SetEyeSpace: PROC[ context: REF Context ]; -- get worldspace to eyespace matrix SetWindow: PROC[context: REF Context, size: Imager.Rectangle]; WindowFromViewPort: PROC[viewPort: Imager.Rectangle] RETURNS[Imager.Rectangle]; SetViewPort: PROC[context: REF Context, size: Imager.Rectangle]; FillViewPort: PROC[context: REF Context, clr: RGB]; -- clears for new image FillInBackGround: PROC[context: REF Context]; -- loads background behind current image SetView: PROC[context: REF Context, eyePoint, ptOfInterest: Triple, fieldOfView: REAL _ 40.0, rollAngle: REAL _ 0.0, upDirection: Triple _ [ 0., 0., 1.], hitherLimit: REAL _ .01, yonLimit: REAL _ 1000.0]; SetLight: PROC[context: REF Context, name: Rope.ROPE, position: Triple, color: RGB _ [1., 1., 1.]] RETURNS[REF ShapeInstance]; DeleteLight: PROC[context: REF Context, name: Rope.ROPE]; GetAmbientLight: PROC[context: REF Context, normal: Triple] RETURNS[RGB]; ReadScene: PROC[context: REF Context, input: IO.STREAM]; WriteScene: PROC[context: REF Context, output: IO.STREAM]; <> NewShape: PROC[ name: Rope.ROPE ] RETURNS[REF ShapeInstance]; FindShape: PROC[ set: REF ShapeSequence, name: Rope.ROPE ] RETURNS[REF ShapeInstance]; AddShape: PROC[ set: REF ShapeSequence, shape: REF ShapeInstance ] RETURNS[REF ShapeSequence]; DeleteShape: PROC[ set: REF ShapeSequence, name: Rope.ROPE ] RETURNS[REF ShapeSequence]; CopyShape: PROC[ shape: REF ShapeInstance, newName: Rope.ROPE ] RETURNS[REF ShapeInstance]; PlaceShape: PROC[ shape: REF ShapeInstance, location: Triple]; -- absolute position MoveShape: PROC[ shape: REF ShapeInstance, delta: Triple]; -- relative position OrientShape: PROC[ shape: REF ShapeInstance, axis: Triple]; -- tilt from vertical RotateShape: PUBLIC PROC[ shape: REF ShapeInstance, axisBase, axisEnd: Triple, theta: REAL ]; <> SetPosition: PROC[shape: REF ShapeInstance, concat: BOOLEAN _ FALSE]; <> PutShading: PROC[ shape: REF ShapeInstance, key: ATOM, value: REF ANY]; GetShading: PROC[ shape: REF ShapeInstance, key: ATOM ] RETURNS [value: REF ANY]; <> InitShades: PROC[ shape: REF ShapeInstance ] RETURNS[shade: REF ShadingSequence]; GetClipCodeForPt: PROC[context: REF Context, pt: Triple] RETURNS[clip: OutCode]; XfmPtToEyeSpace: PROC[context: REF Context, pt: Triple] RETURNS[Triple, OutCode]; XfmPtToDisplay: PROC[context: REF Context, shape: REF ShapeInstance, pt: Triple] RETURNS[Triple]; ShadeVtx: PROC [context: REF Context, pt: VertexInfo, shininess: REAL] RETURNS [RGB, REAL]; XfmToEyeSpace: PROC[context: REF Context, shape: REF ShapeInstance] RETURNS[ClipState]; XfmToDisplay: PROC[context: REF Context, shape: REF ShapeInstance]; GetVtxShades: PROC[ context: REF Context, shape: REF ShapeInstance ]; END.