DIRECTORY Graphics, GraphicsColor, Rope, SV2d, SV3d, SVModelTypes; CSGGraphics: DEFINITIONS = BEGIN Artwork: TYPE = SVModelTypes.Artwork; Color: TYPE = GraphicsColor.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; StrokeEnds: TYPE = Graphics.StrokeEnds; Vector: TYPE = SV3d.Vector; 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: Graphics.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: Vector, localCS: CoordSystem] RETURNS [worldVector: Vector]; DrawFrame: PROC [dc: Graphics.Context, camera: Camera]; SetCP: PROC [dc: Graphics.Context, point3d: Point3d, camera: Camera, localCS: CoordSystem]; SetCPAbsolute: PROC [dc: Graphics.Context, point3d: Point3d, camera: Camera]; DrawTo: PROC [dc: Graphics.Context, point3d: Point3d, camera: Camera, localCS: CoordSystem]; DrawToAbsolute: PROC [dc: Graphics.Context, point3d: Point3d, camera: Camera]; MoveTo: PROC [path: Graphics.Path, point3d: Point3d, camera: Camera, localCS: CoordSystem]; MoveToAbsolute: PROC [path: Graphics.Path, point3d: Point3d, camera: Camera]; LineTo: PROC [path: Graphics.Path, point3d: Point3d, camera: Camera, localCS: CoordSystem]; LineToAbsolute: PROC [path: Graphics.Path, point3d: Point3d, camera: Camera]; DrawStroke: PROC [dc: Graphics.Context, path: Graphics.Path, width: REAL _ 1, closed: BOOLEAN _ FALSE, ends: StrokeEnds _ butt]; DrawFilled: PROC[dc: Graphics.Context, path: Graphics.Path, parityFill: BOOLEAN _ FALSE]; DrawPolygonAbsolute: PROC [dc: Graphics.Context, poly: Poly3d, width: REAL _ 1, ends: StrokeEnds _ butt, camera: Camera]; DrawLine: PROC [dc: Graphics.Context, start: Point3d, end: Point3d, camera: Camera, localCS: CoordSystem]; DrawLineOnScreen: PROC [dc: Graphics.Context, screenPoint1, screenPoint2: Point2d, camera: Camera]; DrawChar: PROC [dc: Graphics.Context, c: CHARACTER, camera: Camera]; DrawArea: PROC [dc: Graphics.Context, localNormal: Vector, poly3d: Poly3d, artwork: Artwork, lightSources: LightSourceList, camera: Camera, localCS: CoordSystem]; DrawAreaNormalAbsolute: PROC [dc: Graphics.Context, cameraNormal: Vector, poly3d: Poly3d, artwork: Artwork, lightSources: LightSourceList, camera: Camera, localCS: CoordSystem]; DrawAreaAbsolute: PROC [dc: Graphics.Context, poly3d: Poly3d, camera: Camera]; DrawHorizonOfPlane: PROC [dc: Graphics.Context, plane: Plane, camera: Camera, localCS: CoordSystem]; DrawHorizonOfPlaneAbsolute: PROC [dc: Graphics.Context, plane: Plane, camera: Camera]; DrawInfiniteLine: PROC [dc: Graphics.Context, p1, p2: Point3d, camera: Camera, localCS: CoordSystem]; DrawInfiniteLineAbsolute: PROC [dc: Graphics.Context, p1, p2: Point3d, camera: Camera, localCS: CoordSystem]; DrawInfinitePlaneWireFrame: PROC [dc: Graphics.Context, plane: Plane, camera: Camera, localCS: CoordSystem]; DrawInfinitePlaneWireFrameAbsolute: PROC [dc: Graphics.Context, plane: Plane, camera: Camera, localCS: CoordSystem]; DrawInfinitePlaneShaded: PROC [dc: Graphics.Context, plane: Plane, artwork: Artwork, lightSources: LightSourceList, camera: Camera, localCS: CoordSystem]; DrawInfinitePlaneShadedAbsolute: PROC [dc: Graphics.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 May 23, 1985 10:59:53 pm PDT 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šœ3™3Lšœ]™]L˜šΟk ˜ Lšœ ˜ Lšœ˜L˜L˜L˜Lšœ ˜ —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šŸœœ(˜2Lšœ@™@—šŸ œœ$œ˜RLšœ@™@—LšŸ œœ-œ˜_LšŸ œœ*œ˜WLšŸ œœ(œ˜YL˜šŸ œœ(˜7L™A—L™