<<>> <> <> <> <> <> DIRECTORY Atom, CedarProcess, G2dBasic, G3dBasic, G3dLight, G3dMatrix, G3dShape, Imager, ImagerPixel, ImagerSample, ImagerColor, IO, Rope, ViewerClasses; G3dRender: CEDAR DEFINITIONS ~ BEGIN <> Error: SIGNAL [code: ATOM, reason: ROPE]; -- we're able to resume this error <> Box: TYPE ~ G2dBasic.Box; Pair: TYPE ~ G3dBasic.Pair; Triple: TYPE ~ G3dBasic.Triple; Light: TYPE ~ G3dLight.Light; LightSequence: TYPE ~ G3dLight.LightSequence; Matrix: TYPE ~ G3dMatrix.Matrix; Shape: TYPE ~ G3dShape.Shape; ShapeSequence: TYPE ~ G3dShape.ShapeSequence; Rectangle: TYPE ~ Imager.Rectangle; RGB: TYPE ~ ImagerColor.RGB; PixelMap: TYPE ~ ImagerPixel.PixelMap; SampleMap: TYPE ~ ImagerSample.SampleMap; ROPE: TYPE ~ Rope.ROPE; <> DisplayMode: TYPE ~ {gray, dither, fullColor}; RenderData: TYPE ~ REF RenderDataRep; RenderDataRep: TYPE ~ RECORD [ renderStyle: RenderStyle ¬ faceted, color: RGB ¬ [1, 1, 1], diffuseReflectivity: REAL ¬ 1.0, specularReflectivity: REAL ¬ 0.0, metallicity: REAL ¬ 0.0, shininess: REAL ¬ 0.0, transmittance: REAL ¬ 0.0, textures: LIST OF TextureMap ¬ NIL ]; RenderStyle: TYPE ~ { faceted, smooth, lines, shadedLines, hiddenLines, linesWnormals, controlPoints }; TextureStyle: TYPE ~ {none, intensity, color, bump, function}; TextureMap: TYPE ~ REF TextureMapRep; TextureMapRep: TYPE ~ RECORD [ style: TextureStyle, name: ROPE, range: Pair, -- circumvent seam matching scale: Pair, bumpHeight: REAL, filter: BOOL ]; Context3d: TYPE ~ REF Context3dRep; Context3dRep: TYPE ~ RECORD [ <> props: Atom.PropList ¬ NIL, -- catchall clientData: REF ANY ¬ NIL, -- data storage for a client <> clear: BOOL ¬ FALSE, -- clear screen before rendering? antiAliasing: BOOL ¬ FALSE, -- flag for antialiasing and alpha buffer <> backgroundColor: RGB ¬ [0.7, 0.5, 1.0], -- background backgroundName: ROPE ¬ NIL, backgroundImage: SampleMap ¬ NIL, matteBackground: BOOL ¬ TRUE, -- matte background? <> frameNumber: NAT ¬ 0, -- current frame for animation routines <> eyePoint: Triple ¬ [1.0, -5.0, 2.0], -- point from which view is seen lookAt: Triple ¬ [0.0, 0.0, 0.0], -- defines center of image and focus rollAngle: REAL ¬ 0.0, -- rotational angle about view direction upDirection: Triple ¬ [0.0, 0.0, 1.0], -- "heads-up" direction (redundant) fieldOfView: REAL ¬ 40.0, -- horizontal angle for field of view window: Rectangle ¬ [0,0,0,0], -- clips field of view in eyespace hitherLimit: REAL ¬ 1.0, -- anything closer to eyepoint is clipped yonLimit: REAL ¬ 1000.0, -- further from eyepoint is clipped scale: REAL ¬ 1.0, -- scale applied to view transformation view: Matrix ¬ NIL, -- world space to eyespace <> viewport: Rectangle ¬ [0,0,0,0], -- in floating pt. display coordinates screenExtent: Box ¬ [[0, 0], [0, 0]], -- bounds area (while building image) displayMode: DisplayMode ¬ dither -- type of image to be displayed ]; <> Create: PROC RETURNS [Context3d]; <> <> SetViewFromParameters: PROC [ context3d: Context3d, fieldOfView: REAL ¬ 40.0, scale: REAL ¬ 1.0, moves, rotates: Triple ¬ []]; <> SetView: PROC [ context3d: Context3d, eyePoint: Triple, lookAt: Triple, fieldOfView: REAL ¬ 40.0, rollAngle: REAL ¬ 0.0, upDirection: Triple ¬ [0., 0., 1.], hitherLimit: REAL ¬ .01, yonLimit: REAL ¬ 1000.0]; <> SetViewport: PROC [context3d: Context3d, size: Rectangle]; <> SetWindow: PROC [context3d: Context3d, size: Rectangle]; <> <> NameBackgroundColor: PROC [context3d: Context3d, color: ROPE]; <> SetBackgroundColor: PROC [context3d: Context3d, color: RGB]; <> SetBackgroundImage: PROC [context3d: Context3d, name: ROPE]; <> EnableClear: PROC [context3d: Context3d, on: BOOL]; <> <<>> MatteBackground: PROC [context3d: Context3d, matte: BOOL]; <> <> RenderDataFrom: PROC [shape: Shape] RETURNS [data: RenderData]; <> <<>> SetRenderStyle: PROC [shape: Shape, renderStyle: RenderStyle]; <> <<>> SetDiffuse: PROC [shape: Shape, diffuseReflectivity: REAL]; <> <<>> SetSpecular: PROC [shape: Shape, specularReflectivity: REAL]; <> <<>> SetMetallicity: PROC [shape: Shape, metallicity: REAL]; <> <<>> SetShininess: PROC [shape: Shape, shininess: REAL]; <> <<>> SetColor: PROC [shape: Shape, color: RGB]; <> <<>> SetTransmittance: PROC [shape: Shape, transmittance: REAL]; <> <> <<>> SetInvisible: PROC [shape: Shape]; <> <<>> SetVisible: PROC [shape: Shape]; <> <<>> ShowBackfaces: PROC [shape: Shape]; <> <<>> HideBackfaces: PROC [shape: Shape]; <> <<>> AddAxes: PROC [ context3d: Context3d, origin: Triple ¬ [0, 0, 0], size: REAL ¬ 1.0, scale: Triple ¬ [1, 1, 1], nReticles: NAT ¬ 20]; <> <> <> SetTextureMap: PROC [ shape: Shape, fileName: ROPE, textureStyle: TextureStyle ¬ intensity, textureFiltering: BOOL ¬ FALSE] RETURNS [error: ROPE]; <> <<>> GetTextureMap: PROC [shape: Shape, textureName: ROPE] RETURNS [TextureMap]; <> <<>> OffsetTextureCoords: PROC [shape: Shape, offset: Pair]; <> <<>> SetTextureScale: PROC [shape: Shape, textureName: ROPE, scale: Pair ¬ [1.0, 1.0]]; <> <<>> SetTextureRange: PROC [shape: Shape, textureName: ROPE, range: Pair]; <> <<>> SetTextureFiltering: PROC [shape: Shape, textureName: ROPE, on: BOOL]; <> <<>> SetBumpHeight: PROC [shape: Shape, textureName: ROPE, height: REAL ¬ 1.0]; <> <> Render: PROC [context3d: Context3d, image: REF, fork: BOOL ¬ TRUE] RETURNS [error: ROPE]; <> <> <<>> RenderToFile: PROC [ context3d: Context3d, fileName: ROPE, fork: BOOL ¬ TRUE, abekas: BOOL ¬ FALSE]; <> WaitTilRenderDone: PROC; <> IsRendering: PROC [context3d: Context3d] RETURNS [BOOL]; <> <<>> AbortRender: PROC [context3d: Context3d]; <> <<>> SetAntiAliasing: PROC [context3d: Context3d, on: BOOL ¬ TRUE]; <> <<>> AntiAliasingNeeded: PROC [context3d: Context3d] RETURNS [BOOL]; <> <> <<>> GetBuffer: PROC [context3d: Context3d, type: ATOM] RETURNS [SampleMap]; <> <> AtomFromTextureStyle: PROC [textureStyle: TextureStyle] RETURNS [ATOM]; <> <<>> AtomFromDisplayMode: PROC [displayMode: DisplayMode] RETURNS [ATOM]; <> <<>> RopeFromDisplayMode: PROC [displayMode: DisplayMode] RETURNS [ROPE]; <> <<>> RopeFromRenderStyle: PROC [renderStyle: RenderStyle] RETURNS [ROPE]; <> <<>> RopeFromTextureStyle: PROC [textureStyle: TextureStyle] RETURNS [ROPE]; <> END.