DIRECTORY CoordSys, Graphics, GraphicsColor, Matrix3d, Rope, Shading, SVArtwork, SVPolygon3d, SVVector3d; CSGGraphics: DEFINITIONS = BEGIN Artwork: TYPE = REF ArtworkObj; ArtworkObj: TYPE = SVArtwork.ArtworkObj; Camera: TYPE = REF CameraObj; Color: TYPE = GraphicsColor.Color; CoordSystem: TYPE = REF CoordSysObj; CoordSysObj: TYPE = CoordSys.CoordSysObj; DrawStyle: TYPE = {wire, shaded, rayCast, normals}; -- if you change this, remember to update DrawStyleToRope and RopeToDrawStyle below. Matrix4by4: TYPE = Matrix3d.Matrix4by4; Plane: TYPE = SVPolygon3d.Plane; Point3d: TYPE = Matrix3d.Point3d; Point2d: TYPE = Matrix3d.Point2d; Poly3d: TYPE = REF Poly3dObj; Poly3dObj: TYPE = SVPolygon3d.Poly3dObj; LightSource: TYPE = REF LightSourceObj; LightSourceObj: TYPE = Shading.LightSourceObj; LightSourceList: TYPE = Shading.LightSourceList; -- LIST OF LightSource; StrokeEnds: TYPE = Graphics.StrokeEnds; Vector: TYPE = SVVector3d.Vector; CameraObj: TYPE = RECORD [ viewName: Rope.ROPE, coordSys: CoordSystem, screenCS: CoordSystem, resolution: REAL, focalLength: REAL, frame: FrameBox, clippingPlanes: LIST OF Plane, visibleAssemblies: LIST OF Rope.ROPE, style: DrawStyle, colorFilm: BOOL, quality: QualityMode, abort: BOOL _ FALSE]; QualityMode: TYPE = {fast, quality}; FrameBox: TYPE = REF FrameBoxObj; FrameBoxObj: TYPE = RECORD [ downLeft: Point2d, upRight: Point2d, fullScreen: BOOL]; -- these points are in CAMERA coordinates CreateCamera: PROC [viewName: Rope.ROPE, coordSys: CoordSystem, screenCS: CoordSystem, resolution: REAL, focalLength: REAL, clippingPlanes: LIST OF Plane, visibleAssemblies: LIST OF Rope.ROPE, style: DrawStyle] 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]; GetPerspective: PROC [point3d: Point3d, camera: Camera] RETURNS [point2d: 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]; MoveTo: PROC [path: Graphics.Path, point3d: Point3d, camera: Camera, localCS: CoordSystem]; SetCPAbsolute: PROC [dc: Graphics.Context, point3d: Point3d, camera: Camera]; MoveToAbsolute: PROC [path: Graphics.Path, point3d: Point3d, camera: Camera]; LineTo: PROC [path: Graphics.Path, point3d: Point3d, camera: Camera, localCS: CoordSystem]; DrawTo: PROC [dc: Graphics.Context, point3d: Point3d, camera: Camera, localCS: CoordSystem]; LineToAbsolute: PROC [path: Graphics.Path, point3d: Point3d, camera: Camera]; DrawToAbsolute: PROC [dc: Graphics.Context, point3d: Point3d, camera: Camera]; DrawStroke: PROC [dc: Graphics.Context, path: Graphics.Path, width: REAL _ 1, closed: BOOLEAN _ FALSE, ends: StrokeEnds _ butt]; DrawLine: PROC [dc: Graphics.Context, start: Point3d, end: Point3d, camera: Camera, localCS: CoordSystem]; DrawOnScreen: PROC [dc: Graphics.Context, screenPoint1, screenPoint2: Point2d, 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]; DrawArea: PROC [dc: Graphics.Context, normal: Vector, poly3d: Poly3d, artwork: Artwork, lightSources: LightSourceList, camera: Camera, localCS: CoordSystem]; DrawAreaNormalAbsolute: PROC [dc: Graphics.Context, normal: Vector, poly3d: Poly3d, artwork: Artwork, lightSources: LightSourceList, camera: Camera, localCS: CoordSystem]; DrawAreaAbsolute: PROC [dc: Graphics.Context, poly3d: Poly3d, camera: Camera]; DrawStyleToRope: PROC [drawStyle: DrawStyle] RETURNS [rope: Rope.ROPE]; RopeToDrawStyle: PROC [rope: Rope.ROPE] RETURNS [drawStyle: DrawStyle, success: BOOL]; END. φFile: CSGGraphics.mesa Last edited by Bier on August 15, 1983 4:10 pm 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. Make a line drawing of the rectangular bounding frame of camera. 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. normal and poly3d in local coordinates. normal is assumed to be in Camera coordinates. poly3d in local coordinates. Area is drawn a solid color so normal information is not needed. poly3d in Camera coordinates. Κ– "cedar" style˜Iheadšœ™Iprocšœ.™.Lšœ]™]L˜šΟk ˜ Lšœ ˜ Lšœ ˜ Lšœ˜Lšœ ˜ L˜Lšœ˜Lšœ ˜ Lšœ ˜ Lšœ ˜ —L˜Lšœ  œ˜L˜Lš˜˜Lšœ œœ ˜Lšœ œ˜(Lšœœœ ˜Lšœœ˜"Lšœ œœ ˜$Lšœ œ˜)Lšœ œ%ΟcT˜ˆLšœ œ˜'Lšœœ˜ Lšœ œ˜!Lšœ œ˜!Lšœœœ ˜Lšœ œ˜(Lšœ œœ˜'Lšœœ˜.Lšœœž˜HLšœ œ˜'Lšœœ˜!L˜šœ œœ˜Lšœœ˜Lšœ˜Lšœ˜Lšœ œ˜Lšœ œ˜Lšœ˜Lšœœœ˜Lšœœœœ˜%Lšœ˜Lšœ œ˜Lšœ˜Lšœœœ˜—L˜Lšœ œ˜$L˜Lšœ œœ ˜!šœ œœ˜Lšœ˜Lšœ˜Lšœ œž)˜<—L˜LšΟn œœœ<œœœœœœœœ˜μLšŸ œœ:œ˜QLšŸœœœ˜?LšŸœœ%˜;Lšœ7™7LšŸœœœ˜8Lšœa™ašŸœœ(˜2Lšœ@™@—LšŸœœ$œ˜SLšŸ œœ-œ˜_LšŸ œœ*œ˜WLšŸ œœ(œ˜YL˜šŸ œœ(˜7L™A—LšŸœœP˜[LšŸœœO˜[LšŸ œœ:˜MLšŸœœ9˜MLšŸœœO˜[LšŸœœP˜\LšŸœœ9˜MLšŸœœ:˜NLšŸ œœ4œ˜MLšœ œœ˜4LšŸœœ\˜jLšŸ œœN˜`šŸœœL˜dL™—šŸœœ6˜VL™—šŸœœO˜eL™1—šŸœœO˜mL™3—šŸœœL˜lL™,—šŸ"œœL˜tL™.—šŸœœ}˜šL™,—šŸœœg˜ŒL™.—L˜šŸœœ˜Lšœ(™(—šŸœœ˜«LšœL™L—šŸœœ8˜NLšœ`™`—LšŸœœœ œ˜GLš Ÿœœ œœ!œ˜V—L˜Lšœ˜—…—:6