home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / d / dots151.zip / GRAPHSRC.ZIP / G3.DOC < prev    next >
Text File  |  1989-02-21  |  5KB  |  119 lines

  1. NAME
  2.     g31.c, g32.c, g3.h - portable Core System graphics package
  3.  
  4. DESCRIPTION
  5.     This is a portable implementation of the Core System graphics
  6.     package intended for implementation on microcomputers with graphics
  7.     approximately equivalent to the IBM PC.  The Core System is
  8.     described in Computer Graphics vol 13, no 3 (Aug 79), reprints of
  9.     which are available from the Association for Computing Machinery
  10.     (item number 428791).  You can call ACM at 1-800-526-0359, ext. 
  11.     75, to order a copy.
  12.  
  13.     I chose to implement the Core System because it was designed from
  14.     the ground up to be a three dimensional standard (unlike GKS, for
  15.     example).
  16.  
  17.     Three classes of upward compatible levels are specified for Core
  18.     Systems; one class for output, one class for input, and one class
  19.     concerning dimensionality.  This implementation has:
  20.  
  21.         Output level 1: basic output
  22.  
  23.             There are no retained segments or image transformations
  24.             (not to be confused with viewing transformations, which
  25.             are of course provided).  Of the text primitives, only
  26.             text() is provided, and text is generated only in
  27.             "string_precision" (CHARPLANE, CHARUP, CHARPATH, and
  28.             CHARSPACE not implemented).  This means that strings
  29.             are always displayed from left to right, and there are
  30.             no tilted characters.
  31.  
  32.         Input level 1: no input
  33.  
  34.             A simple cursor key interface is provided.
  35.  
  36.         Dimension level 2: three dimensional
  37.  
  38.             All 2D and 3D viewing transformations are provided.
  39.  
  40.     Some inquiry and setting functions have not been implemented - for
  41.     example, set_viewing_parameters(viewing_parameter_array).  Some viewing
  42.     operation functions may still follow the definitions in the 1977 draft
  43.     of the Core System.
  44.  
  45.     None of the "raster extensions" have been implemented.
  46.  
  47. USAGE
  48.     A program using G3 consists of three layers of software.  First is the
  49.     application software, which interacts with the user, reads data, and
  50.     generates an image in "world coordinates" using calls to the output
  51.     primitives.  Second is the Core System graphics package itself
  52.     (files G31.C and G32.C) which converts the image from world
  53.     coordinates (doubles) to screen coordinates (integers).  The third
  54.     layer deals with the graphics hardware and is therefore machine
  55.     dependent.
  56.  
  57.     One way to structure the application program is as follows:
  58.  
  59.         <read_data>
  60.         <initialize>
  61.         do    {
  62.             <specify coordinate transformation>
  63.             <open segment> 
  64.             <generate image> 
  65.             <close segment>
  66.             <get input from user>
  67.             }    while (not_finished);
  68.         <terminate>
  69.  
  70.     For examples, see GRAPH, DOTS, and GLOBE.
  71.  
  72. IMPLEMENTATION
  73.     This package was written for the DeSmet C compiler.  G31 and G32 are
  74.     entirely in C, and are not known to depend on the operating system. 
  75.     The interface routines such as GPC and GZ are partly assembly
  76.     language, which the DeSmet compiler permits to be intermingled with
  77.     the C code.  They require MS-DOS 2.0 or higher (because of their
  78.     use of the environment).
  79.  
  80.     This implementation was written with approximately these priorities:
  81.     (1) correctness (freedom from visible glitches), (2) speed, and (3)
  82.     functionality.
  83.  
  84.     This package requires a set of interface variables and
  85.     functions for each machine.  I've written these device drivers
  86.     for CGA, EGA, and Hercules adaptors on an IBM, the Zenith
  87.     Z-100, the Houstin Instruments DMP-29 and Hewlett Packard 7470A
  88.     plotters, Postscript, and the CIE LIPS-10 laser printer.  Some
  89.     of these drivers implement more than one graphics modes.  The
  90.     user chooses among modes by setting the environment variable
  91.     GRAPHICS to a number.  Similarly, the environment variable
  92.     PLOT_PORT has the name of the output port for a plotter or
  93.     printer.  I chose that method so the application software would
  94.     remain ignorant of the existence of multiple modes.  (This does
  95.     mean that the application software should initialize the
  96.     graphics before using any of the variables declared in G.H.) An
  97.     alternative would be to put equivalent data into a
  98.     configuration file.
  99.  
  100.     I'd be glad to work with anyone who wants to port the package
  101.     onto other computers or other compilers.  Anyone attempting
  102.     this for a display screen should use BENCH to verify their
  103.     implementation.
  104.  
  105.     There are many things I haven't implemented.  I'd especially
  106.     like to see some of the raster extensions, like area fill and
  107.     hidden line removal.  Note - the Core System package currently
  108.     does not require the line erase function.  It will require that
  109.     function if is extended to include retained segments.  If no
  110.     line erase function is defined, the variable erase_line should
  111.     be set to point to the line drawing routine.
  112.  
  113. AUTHOR
  114.     Copyright (c) 1985 - 1989 by James R. Van Zandt
  115.     (jrv@mitre-bedford) 27 Spencer Dr., Nashua NH 03062, 603-888-2272. 
  116.     Resale forbidden, copying for personal use encouraged. 
  117.     Constructive comments welcome.  
  118.  
  119.