CONTENTS Title Page Copyright Page Preface 1 Overview of DEC GKS-3D 1.1 DEC GKS-3D and the GKS-3D Standard 1.2 Software Components of DEC GKS-3D 1.3 Workstation-Independent Components 1.4 Workstations and Workstation Handlers 1.5 Data Structures 2 Developing a DEC GKS-3D Program 2.1 Data Types 2.2 Writing System-Independent Programs 2.3 Writing Device-Independent Programs 3 Controlling DEC GKS-3D and Workstations 3.1 Opening and Closing DEC GKS-3D and Workstations 3.2 GKS-3D Operating States 3.3 Implicit Regeneration of the Workstation Surface 3.4 Deferral of Output on the Workstation 4 Primitives and Attributes 4.1 Output Functions 4.2 Types of Primitive Attributes 4.3 Binding Attributes to Primitives 4.4 Primitive Attribute Types 4.5 Setting Nongeometric Attributes 4.5.1 Bundled Attributes and Aspect Source Flags 4.5.2 Setting and Accessing Bundle Index Representations 4.6 Setting Geometric Attributes 5 Transforming the Picture 5.1 GKS-3D Coordinate Systems and Transformations 5.2 Viewing Pipeline 5.2.1 Normalization Transformation: World to Normalized Device Coordinates 5.2.2 View Transformation: Normalized Device to Normalized Projection Coordinates 5.2.2.1 Computing the View Orientation Matrix 5.2.2.2 Computing the View Mapping Matrix 5.2.2.3 Calculating the View Volume: Parallel Projection 5.2.2.4 Calculating the View Volume: Perspective Projection 5.2.2.5 Clipping the Image 5.2.3 Device Transformation: Normalized Projection to Device Coordinates 5.2.4 Hidden Line Hidden Surface Removal 6 Using Segments 6.1 Properties of Segments 6.2 Operations on Segments 6.2.1 Creating, Closing, Deleting, and Renaming Segments 6.2.2 Modifying Segment Attributes 6.2.3 Transforming Segments 6.2.4 Understanding Segment Transformation Matrixes 6.3 Operations on Segments Stored in WISS 7 Data Input 7.1 Input Devices, Modes, and Classes 7.2 Logical Input Devices 7.2.1 Characteristics of Logical Input Devices 7.2.2 Classes of Logical Input Device 7.3 Input Modes 7.3.1 How to Select an Input Mode 7.3.2 Synchronous Input: REQUEST Mode 7.3.3 Asynchronous Input: SAMPLE and EVENT Modes 7.3.4 The Event Input Report Queue 7.3.4.1 Removing Reports from the Queue 7.3.4.2 Generating Simultaneous Events 7.3.4.3 Overflow of the Input Queue 7.4 Viewport Priority in LOCATOR and STROKE Input 7.4.1 Selecting the Viewport 7.4.2 Controlling LOCATOR, STROKE, and PICK Prompts 7.5 Selecting Prompt and Echo Types 7.5.1 Controlling the Prompt Interface: Input Data Record 8 Storing the Picture in a Metafile 8.1 Using Metafile Functions 8.2 Creating and Interpreting Metafiles 8.3 Understanding Metafile Structure 8.3.1 Data Format Information 8.3.2 GKS-3D Metafile Structure 8.3.2.1 Metafile Header Structure 8.3.2.2 Metafile Item Structure 8.3.2.3 Item Header Structure 8.3.2.4 Layout of Item Data Records 8.4 GKS-3D Metafile Physical File Organization 9 Interrogating GKS-3D: Using Inquiry Functions 10 Error Handling 10.1 Error Types and Error Messages 10.2 Calling the Error Handler A Initial Attribute Values A.1 Initial Polyline Attributes A.2 Initial Polymarker Attributes A.3 Initial Text Attributes A.4 Initial Fill Area Attributes A.5 Initial Segment Attributes A.6 Initial Normalization Transformation Settings B ADA Program Example C Pascal Program Example D FORTRAN Program Example E C Program Example F GKS3D$ Program Example G DEC GKS-3D Device-Independent Fonts G.1 Font File Formats G.2 DEC GKS-3D Device-Independent Fonts H Mathematical Concepts H.1 Vectors H.1.1 Dot Product Multiplication H.1.2 Cross Product Multiplication H.2 Viewing and Rendering Algorithms H.2.1 Deriving the Viewing Vectors H.3 Scale Matrix H.4 Translate Matrix H.5 Rotation H.5.1 X Rotation H.5.2 Y Rotation H.5.3 Z Rotation EXAMPLES 3-1 Code to Start and Finish a DEC GKS-3D Program 4-1 Code to Draw a Cube 4-2 Commands to Set Attributes: Fill Area and Text 6-1 Commands for Creating and Deleting Segments 6-2 Transformation Matrix Code 6-3 Code to Copy a Segment from WISS to a Workstation 7-1 Code to Clear the Input Queue 7-2 Code to Use Input Viewport Priority 7-3 Code to Limit Echo Area 8-1 Code to Interpret a Metafile 9-1 Inquiry Functions G-1 Printing the ASCII Values of Font Characters FIGURES 1-1 Software Components of DEC GKS-3D 3-1 GKS-3D Operating States 4-1 Binding of Attributes 4-2 Specifying Bundled and Individual Aspect Source Flags 5-1 A 3D Picture in World Coordinates 5-2 The GKS-3D Viewing Pipeline 5-3 House in Normalized Device Coordinates 5-4 Computation of the U,V,N Axes 5-5 Parallel and Perspective Projections 5-6 The View Volume in a Parallel Projection 5-7 The View Volume in a Perspective Projection 5-8 Clipping the Image: Parallel and Perspective Projections 5-9 Clipped Image of House in Device Coordinates 6-1 The Segment Transformation and Clipping Pipeline 7-1 Prompts for GKS-3D Input 7-2 Relationship Between Measure and Trigger for Different Input Modes 7-3 Generating Event Input Reports with CHOICE 7-4 Removing Reports from the Input Queue 7-5 Generating Simultaneous Event Reports with CHOICE and VALUATOR 7-6 Locator Prompt Types 8-1 GKS-3D Metafile Structure 8-2 GKS-3D Metafile Header Structure 8-3 GKS-3D Metafile Item Structure 8-4 GKS-3D Metafile Item Header Structure G-1 DEC GKS-3D Font Lines G-2 ISO Standard Character Set (Font Number 1) G-3 Small Uniplex Simplex Roman and Greek (Font Number -2) G-4 Large Simplex Uniplex Roman (Font Number -3) G-5 Large Uniplex Simplex Greek (Font Number -4) G-6 Large Simplex Uniplex Script (Font Number -5) G-7 Medium Complex Duplex Roman (Font Number -6) G-8 Medium Complex Duplex Greek (Font Number -7) G-9 Medium Complex Duplex Italic (Font Number -8) G-10 Large Complex Duplex Roman (Font Number -9) G-11 Large Complex Duplex Greek (Font Number -10) G-12 Large Complex Duplex Italic (Font Number -11) G-13 Large Simplex Duplex Roman (Font Number -12) G-14 Large Complex Duplex Script (Font Number -13) G-15 Large Complex Duplex Cyrillic (Font Number -14) G-16 Large Complex Triplex Roman (Font Number -15) G-17 Large Complex Triplex Italic (Font Number -16) G-18 Large Gothic Triplex German (Font Number -17) G-19 Large Gothic Triplex English (Font Number -18) G-20 Large Gothic Triplex Italian (Font Number -19) G-21 Medium Complex Duplex Special Characters (Font Number -20) G-22 Music, Astronomy, and Business (Font Number -21) G-23 Large Uniplex Special Characters (Font Number -22) G-24 Large Special Characters (Font Number -23) H-1 Two-Dimensional Translation TABLES 1-1 GKS-3D Workstation Types 1-2 Data Structures 2-1 Portability of Language Bindings 3-1 The GKS-3D Operating States 3-2 Functions Requiring an Implicit Regeneration 3-3 Functions Affected by Output Deferral 4-1 Primitives and Relevant Attributes 4-2 Attribute Arrays Used by Aspect Source Flag Functions 5-1 The DEC GKS-3D Coordinate Systems and Transformations 5-2 Functions and Parameters Used in the Normalization Transformation 5-3 Functions and Parameters Used in the View Orientation Transformation 5-4 Functions and Parameters Used in the Device Transformation 6-1 Segment Functions and Operations 7-1 Standard Data Record 8-1 GKS-3D Metafile Header Fields 8-2 GKS-3D Metafile Item Header Fields 8-3 GKS-3D Metafile Data Record Fields G-1 DEC GKS-3D Fonts