C SAMPLE 3-DIMENSIONAL DISPLAY PROGRAM
C
C  THIS PROGRAM MAY BE COMPILED WITH EITHER 'WATRAN' OR
C  OR THE DEC FORTRAN COMPILER.
C
C
C FOLLOWING IS A PROGRAM THAT WILL DISPLAY A 
C CYLINDER IN THREE DIMENSIONAL PERSPECTIVE
C
      INTEGER IVECT(500)
C THE CO-ORDINATE SYSTEM IS FIRST ESTABLISHED:
      COMMON/LIMITS/XMIN,XMAX,YMIN,YMAX
C NEXT, THE VISUAL PERSPECTIVE PARAMETERS:
C
      COMMON/EYCEP/EYE(3),CENTRE(3),UP(3)
C
C FOLLOWED BY THE CONVERSION OF THE CO-ORDINATE
C MATRIX 'OBJECT' INTO THE 2-DIMENSIONAL SCREEN
C ARRAY 'PLANE'.
      COMMON/BULK/I3STRT,I3END,OBJECT(6,60)
      COMMON/PAINT/I2STRT,I2END,PLANE(4,60)
C
C THE DISPLAY IS NOW INITIALIZED
      CALL CLEAR(.TRUE.)
C
C THE CO-ORDINATE SYSTEM IS ASSIGNED:
      XMIN=-20.
      XMAX=20.
      YMIN=XMIN
      YMAX=XMAX
C
C THE VISUAL ARGUEMENTS ARE ASSIGNED:
      EYE(1)=20.
      EYE(2)=15.
      EYE(3)=30.
      CENTRE(1)=0.
      CENTRE(2)=0.
      CENTRE(3)=0.
      UP(1)=0.
      UP(2)=5.
      UP(3)=0.
C
C THE CYLINDER RADIUS IS ASSIGNED:
      RADIUS=3.0
      THETA=.157078
C
C GENERATING THE WALLS OF THE CYLINDER, HAVING 
C HEIGHT OF 4 UNITS:
      DO 10 I=1,40
      OBJECT(1,I)=COS(THETA*FLOAT(I))*RADIUS
      OBJECT(2,I)=SIN(THETA*FLOAT(I))*RADIUS
      OBJECT(3,I)=0.
      OBJECT(4,I)=OBJECT(1,I)
      OBJECT(5,I)=OBJECT(2,I)
 10   OBJECT(6,I)=5.
C
C THE BEGINNING AND END OF THE OBJECT ARRAY:
      I3STRT=1
      I3END=40
C
C THE OBJECT ARRAY WILL BE CONVERTED
C INTO THE PICTURE 'PLANE' ARRAY, STARTING
C AT LOCATION:
      I2STRT=1
C THE VISUAL PARAMTERS ARE
C CALCULATED:
      CALL ROTER
C AND THE PICTURE PLANE ARRAY GENERATED, WITH
C THE EYE POINT BEING 50. UNITS FROM THE PICTURE PLANE.
      DIST=45.
      CALL MAPPER(DIST)
C
C THE PLANE ARRAY IS NOW CONVERTED INTO THE DISPLAY
C FILE 'IVECT':
      CALL VECTOR(1,PLANE,1,I2END,IVECT,1,LAST,7,1,.FALSE.)
C
C IVECT IS DISPLAYED BY CALLING DRAW:
      CALL DRAW(IVECT,1,LAST)
      PAUSE1
      STOP
      END
C
C
C THIS PROGRAM IS AVAILABLE AS A SOURCE VERSION ON THE LIBRARY
C DUMP TAPE, UNDER THE FILE NAME DEMO2 SRC.
