      LOGICAL B1,B2,B3,B4,B5,B6,B7,B8,B9,B10
      DIMENSION FILE(2)
      COMMON/POINTS/PTS(6,18)
      COMMON/EYCEP/EYE(3),CEN(3),UP(3)
      COMMON/BULK/I3STRT,I3END,OBJ(6,100)
      COMMON/PULDAT/N
      COMMON/PAINT/I2STRT,I2END,PIC(4,100)
      COMMON/OIL/IVECT(400)
      COMMON/LIMITS/XMIN,XMAX,YMIN,YMAX
      DATA FILE(1),FILE(2)/4HCUBR,4H SRC/
      DATA ENFOR,EN2,EN3/5H(1X,2,5HHN=,I,2H4)/
      DATA IDS,IDL/2,1/
      CALL CLEAR(.TRUE.)
	CALL DISPLY (0,4000,IGET)
      CALL BUTTON(1)
      I3STRT=1
      I3END=17
      XMIN=-5.0
      XMAX=5.0
      YMIN=-5.0
      YMAX=5.0
      CALL SEEK (1,FILE)
      READ(1,501)((PTS(I,J),I=1,6),J=1,18)
501   FORMAT (6F5.1)
      EYE(1)=0.0
      EYE(2)=0.0
      EYE(3)=10.0
      CEN(1)=0.0
      CEN(2)=0.0
      CEN(3)=0.0
      UP(1)=0.0
      UP(2)=10.0
      UP(3)=0.0
      DIST=8.0
      I2STRT=1
      I2END=17
      MODE=1
      NN=0
      RD=3.1415926/192.0
      DO 502 J=1,6
502   OBJ(J,1)=PTS(J,1)
      I3END=1
      CALL ROTER
      CALL MAPPER(DIST)
      CALL VECTOR(MODE,PIC,I2STRT,I2END,IVECT,1,LAST,7,0,0)
      CALL DISPLY(6,IDL,IVECT,1,LAST)
      CALL DISPLY(6,IDS,IVECT,1,LAST)
      CALL DISPLY(3,IDL)
      IH=IDS
      IDS=IDL
      IDL=IH
15    CALL TEXT(0,0,0,0,0)
      CALL TEXT(800,800,7,1,ENFOR,NN)
10    B1=.FALSE.
      B2=.FALSE.
      B3=.FALSE.
      B4=.FALSE.
      B5=.FALSE.
      B6=.FALSE.
      B7=.FALSE.
      B8=.FALSE.
      B9=.FALSE.
      B10=.FALSE.
      CALL BUTTON(3,B1,B2,B3,B4,B5,B6,B7,B8,B9,B10)
101   CALL BUTTON(2,B1,B2,B3,B4,B5,B6,B7,B8,B,B10)
      IF(B1) GO TO 110
      IF(B2) GO TO 120
      IF(B3) GO TO 130
      IF(B4) GO TO 140
      IF(B5) GO TO 150
      IF(B6) GO TO 160
      IF(B7) GO TO 170
      IF(B8) GO TO 180
      IF(B9) GO TO 190
      IF(B10) GO TO 503
      GO TO 101
503   DO 504 K=1,576
      CALL PULSE(N,N)
504   NN=NN+1
      GO TO 15
130   NN=0
      GO TO 15
140   DO 141 K=1,24
      CALL PULSE(N,N)
141   NN=NN+1
      GO TO 15
150   CALL ZOOM(IDS,IDL,DIST,NN)
      GO TO 15
110   DO 111 J=1,6
111   OBJ(J,1)=PTS(J,18)
      IK=384/4
      CYA=COS(4.0*RD)
      SYA=SIN(4.0*RD)
      DO 112 K=1,IK
      I3END=1
      CALL YARY(CYA,SYA,0.0,0,0)
      CALL ROTMAP(IDS,IDL,DIST)
      CALL PULSE(N,N)
112   NN=NN+1
      GO TO 15
120   IK=384/4
160   IK=384/4
180   IK=384/4
      GO TO 161
170   IK=384/24
190   IK=384/24
161   DO 162 I=1,16
      DO 162 J=1,6
      K=I+1
162   OBJ(J,I)=PTS(J,K)
      IF(B8.OR.B9) GO TO 181
      CRO=COS(-4.0*RD)
      SRO=SIN(-4.0*RD)
      GO TO 163
181   CRO=COS(+4.0*RD)
      SRO=SIN(+4.0*RD)
163   DO 164 K=1,IK
      I3END=1
      CALL RORZ(CRO,SRO,0.0,1.5)
      DO 165 II=3,5
165   OBJ(4,II)=OBJ(4,1)
      IF (B8.OR.B9) GO TO 182
      IF(SRO.GT.0.0) GO TO 167
      GO TO 166
167   OBJ(4,4)=-1.0
      OBJ(4,5)=-1.0
      GO TO 166
182   IF(SRO.LT.0.0) GO TO 167
166   I3END=16
      CALL ROTMAP(IDS,IDL,DIST)
      DO 164 KK=1,4
      CALL PULSE(N,N)
164   NN=NN+1
      GO TO 15
      END
