DIRECTORY Imager, ImagerPath, Rope, SV2d, SV3d, SVModelTypes; CSGGraphics: CEDAR DEFINITIONS = BEGIN Artwork: TYPE = SVModelTypes.Artwork; Color: TYPE = Imager.Color; CoordSystem: TYPE = SVModelTypes.CoordSystem; DrawStyle: TYPE = SVModelTypes.DrawStyle; Matrix4by4: TYPE = SV3d.Matrix4by4; Plane: TYPE = SV3d.Plane; Point3d: TYPE = SV3d.Point3d; Point2d: TYPE = SV2d.Point2d; Poly3d: TYPE = SV3d.Poly3d; QualityMode: TYPE = SVModelTypes.QualityMode; LightSource: TYPE = SVModelTypes.LightSource; LightSourceList: TYPE = SVModelTypes.LightSourceList; -- LIST OF LightSource; StrokeEnd: TYPE = Imager.StrokeEnd; Vector3d: TYPE = SV3d.Vector3d; Camera: TYPE = SVModelTypes.Camera; FrameBox: TYPE = SVModelTypes.FrameBox; Projection: TYPE = SVModelTypes.Projection; CreateCamera: PROC [viewName: Rope.ROPE, coordSys: CoordSystem, screenCS: CoordSystem, resolution: REAL, focalLength: REAL, projection: Projection, frame: FrameBox, clippingPlanes: LIST OF Plane, visibleAssemblies: LIST OF Rope.ROPE, style: DrawStyle, colorFilm: BOOL, useBoundBoxes: BOOL, useBoundSpheresForShadows: BOOL] RETURNS [camera: Camera]; PlaceCamera: PROC [camera: Camera, focus: Point3d, origin: Point3d, slant: REAL]; SetFocalLengthCamera: PROC [camera: Camera, focalLength: REAL]; SetQualityCamera: PROC [camera: Camera, qual: QualityMode]; ColorFilmCamera: PROC [camera: Camera, colorFilm: BOOL]; Clip: PROC [dc: Imager.Context, camera: Camera]; DoProjection: PROC [point3d: Point3d, camera: Camera] RETURNS [newPoint: Point2d]; LocalToCamera: PROC [localPoint: Point3d, localCS: CoordSystem] RETURNS [cameraPoint: Point3d]; LocalToWorld: PROC [localPt: Point3d, localCS: CoordSystem] RETURNS [worldPt: Point3d]; VectorToWorld: PROC [vector: Vector3d, localCS: CoordSystem] RETURNS [worldVector: Vector3d]; DrawFrame: PROC [dc: Imager.Context, camera: Camera]; SetCP: PROC [dc: Imager.Context, point3d: Point3d, camera: Camera, localCS: CoordSystem]; SetCPAbsolute: PROC [dc: Imager.Context, point3d: Point3d, camera: Camera]; DrawTo: PROC [dc: Imager.Context, point3d: Point3d, camera: Camera, localCS: CoordSystem]; DrawToAbsolute: PROC [dc: Imager.Context, point3d: Point3d, camera: Camera]; MoveTo: PROC [path: ImagerPath.Trajectory, point3d: Point3d, camera: Camera, localCS: CoordSystem]; MoveToAbsolute: PROC [path: ImagerPath.Trajectory, point3d: Point3d, camera: Camera]; LineTo: PROC [path: ImagerPath.Trajectory, point3d: Point3d, camera: Camera, localCS: CoordSystem]; LineToAbsolute: PROC [path: ImagerPath.Trajectory, point3d: Point3d, camera: Camera]; DrawStroke: PROC [dc: Imager.Context, path: ImagerPath.Trajectory, width: REAL _ 1, closed: BOOLEAN _ FALSE, ends: StrokeEnd _ butt]; DrawFilled: PROC[dc: Imager.Context, path: ImagerPath.Trajectory, parityFill: BOOLEAN _ FALSE]; DrawPolygonAbsolute: PROC [dc: Imager.Context, poly: Poly3d, width: REAL _ 1, ends: StrokeEnd _ butt, camera: Camera]; DrawLine: PROC [dc: Imager.Context, start: Point3d, end: Point3d, camera: Camera, localCS: CoordSystem]; DrawLineOnScreen: PROC [dc: Imager.Context, screenPoint1, screenPoint2: Point2d, camera: Camera]; DrawChar: PROC [dc: Imager.Context, c: CHARACTER, camera: Camera]; DrawArea: PROC [dc: Imager.Context, localNormal: Vector3d, poly3d: Poly3d, artwork: Artwork, lightSources: LightSourceList, camera: Camera, localCS: CoordSystem]; DrawAreaNormalAbsolute: PROC [dc: Imager.Context, cameraNormal: Vector3d, poly3d: Poly3d, artwork: Artwork, lightSources: LightSourceList, camera: Camera, localCS: CoordSystem]; DrawAreaAbsolute: PROC [dc: Imager.Context, poly3d: Poly3d, camera: Camera]; DrawHorizonOfPlane: PROC [dc: Imager.Context, plane: Plane, camera: Camera, localCS: CoordSystem]; DrawHorizonOfPlaneAbsolute: PROC [dc: Imager.Context, plane: Plane, camera: Camera]; DrawInfiniteLine: PROC [dc: Imager.Context, p1, p2: Point3d, camera: Camera, localCS: CoordSystem]; DrawInfiniteLineAbsolute: PROC [dc: Imager.Context, p1, p2: Point3d, camera: Camera, localCS: CoordSystem]; DrawInfinitePlaneWireFrame: PROC [dc: Imager.Context, plane: Plane, camera: Camera, localCS: CoordSystem]; DrawInfinitePlaneWireFrameAbsolute: PROC [dc: Imager.Context, plane: Plane, camera: Camera, localCS: CoordSystem]; DrawInfinitePlaneShaded: PROC [dc: Imager.Context, plane: Plane, artwork: Artwork, lightSources: LightSourceList, camera: Camera, localCS: CoordSystem]; DrawInfinitePlaneShadedAbsolute: PROC [dc: Imager.Context, plane: Plane, artwork: Artwork, lightSources: LightSourceList, camera: Camera]; DrawStyleToRope: PROC [drawStyle: DrawStyle] RETURNS [rope: Rope.ROPE]; RopeToDrawStyle: PROC [rope: Rope.ROPE] RETURNS [drawStyle: DrawStyle, success: BOOL]; ProjectionToRope: PROC [projection: Projection] RETURNS [rope: Rope.ROPE]; RopeToProjection: PROC [rope: Rope.ROPE] RETURNS [projection: Projection, success: BOOL]; END. ”File: CSGGraphics.mesa Last edited by Bier on February 18, 1987 6:24:33 pm PST Contents: A place to keep the current 3d transform, and the 3d (perspective) drawing routines How you wish to make the speed/print quality trade off. If black and white film is used, all colors will be changed to shades of gray before being shown Clip future drawing operations to the bounding frame of camera. Does perspective or orthogonal projection as required by camera. Make a line drawing of the rectangular bounding frame of camera. DRAW LINE SEGMENTS OR PATHS (all segments are clipped in 3d) Like SetCP but assumes point3d is in CAMERA coords. Like DrawTo but assumes point3d is in CAMERA coords. Like MoveTo but assumes point3d is in CAMERA coords. Like LineTo but assumes point3d is in CAMERA coords. CONVENIENCE ROUTINES Makes a wireframe drawing of the edges of poly assuming that the vertex coordinates are CAMERA coordinates. Clips in 3D. Like DrawTo except that starting and ending points are given at the same time. Like DrawLine except that points are given in SCREEN coordinates. Draws a character at the current point (set by SetCP, SetCPAbsolute, DrawTo, or DrawToAbsolute). Convert the given polygon to WORLD coordinates and use the lighting model specified by artwork to compute the shading. Draw onto dc. localNormal and poly3d are in local coordinates. Like DrawArea, but cameraNormal is in Camera coordinates. poly3d in local coordinates as before. The polygon is drawn a solid color so normal information is not needed. poly3d in Camera coordinates. DRAW INFINITE OBJECTS Plane in local coordinates. Plane in CAMERA coordinates. p1 and p2 are assumed to be in local coordinates. p1 and p2 are assumed to be in CAMERA coordinates. plane is assumed to be in local coordinates. plane is assumed to be in CAMERA coordinates. plane is assumed to be in local coordinates. plane is assumed to be in CAMERA coordinates. Ê®– "cedar" style˜Iheadšœ™Iprocšœ7™7Lšœ]™]L˜šÏk ˜ Lšœ3˜3—L˜Lšœ œ˜ L˜Lš˜˜Lšœ œ˜%Lšœœ˜Lšœ œ˜-Lšœ œ˜)Lšœ œ˜#Lšœœ˜Lšœ œ˜Lšœ œ˜Lšœœ˜Lšœ œ˜-Lšœ œ˜-Lšœœ!Ïc˜MLšœ œ˜#Lšœ œ˜L˜—L˜Lšœœ˜#Lšœ œ˜'Lšœ œ˜+L˜LšÏn œœœ<œœ;œœœœœœœœœ˜ÜLšŸ œœ:œ˜QLšŸœœœ˜?LšŸœœ%˜;Lšœ7™7LšŸœœœ˜8Lšœa™ašŸœœ&˜0Lšœ@™@—šŸ œœ$œ˜RLšœ@™@—LšŸ œœ-œ˜_LšŸ œœ*œ˜WLšŸ œœ*œ˜]L˜šŸ œœ&˜5L™A—L™œœ˜_L˜L™L˜šŸœœ+œ.˜vL™y—šŸœœZ˜hLšœN™N—šŸœœK˜aLšœA™A—šŸœœ œ˜BLšœ`™`—L˜šŸœœ”˜¢Lšœ·™·—šŸœœ•˜±Lšœa™a—šŸœœ6˜LLšœg™g—L™L™šŸœœJ˜bL™—šŸœœ4˜TL™—šŸœœM˜cL™1—šŸœœM˜kL™3—šŸœœJ˜jL™,—šŸ"œœJ˜rL™.—šŸœœ{˜˜L™,—šŸœœe˜ŠL™.—LšŸœœœ œ˜GLš Ÿœœ œœ!œ˜VLšŸœœœ œ˜Jš Ÿœœ œœ#œ˜YL˜—L˜Lšœ˜—…—ä&