      LOGICAL LP
      LOGICAL B1,B2,B3,B4,B5,B6,B7,B8,B9
      COMMON/EYCEP/EYE(3),CEN(3),UP(3)
      COMMON/BULK/I3STRT,I3END,OBJ(6,30)
      COMMON/PAINT/I2STRT,I2END,PIC(4,30)
      COMMON/OIL/IVECT(200)
      COMMON/LIMITS/XMIN,XMAX,YMIN,YMAX
	DATA IDS,IDL/2,1/
      CALL BUTTON(1)
      CALL CLEAR(.TRUE.)
      I3STRT=1
      I3END=18
      XMIN=-5.0
      XMAX=5.0
      YMIN=-5.0
      YMAX=5.0
	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
      I2STRT=1
      I2END=18
      IX=512
      IY=512
      J=1
      OBJ(1,J)=0.0
      OBJ(2,J)=0.0
      OBJ(3,J)=0.0
      OBJ(4,J)=0.0
      OBJ(5,J)=0.0
      OBJ(6,J)=0.0
	DIST=8.0
      CALL ROTER
      CALL MAPPER(DIST)
      CALL VECTOR(1,PIC,I2STRT,I2END,IVECT,1,LAST,7,0,0)
      CALL DISPLY(6,IDL,IVECT,1,LAST)
12    B1=.FALSE.
      B2=.FALSE.
      B3=.FALSE.
      B4=.FALSE.
      B5=.FALSE.
      B6=.FALSE.
      B7=.FALSE.
      B8=.FALSE.
      B9=.FALSE.
10    CALL BUTTON(3,B1,B2,B3,B4,B5,B6,B7,B8,B9)
2     CALL BUTTON(2,B1,B2,B3,B4,B5,B6,B7,B8,B9)
      IF(B1) GO TO 21
      IF(B2) GO TO 21
      GO TO 2
21    CALL CROSS(.TRUE.,IX,IY)
211   CALL BUTTON(2,B1,B2,B3,B4,B5,B6,B7,B8,B9)
	IF(B9) GO TO 22
	GO TO 211
22    CALL CROSS(.FALSE.,IX,IY)
      EX=IX
      EY=IY
      DX=(EX-512.0)/81.7
      DY=(EY-512.0)/81.7
	CALL CROSS(.TRUE.,IX,IY)
      J=J+1
      K=J-1
      OBJ(1,J)=OBJ(4,K)
      OBJ(2,J)=OBJ(5,K)
      OBJ(3,J)=0.0
	OBJ(4,J)=DX
	OBJ(5,J)=DY
      OBJ(6,J)=0.0
      CALL ROTER
      CALL MAPPER(DIST)
      CALL VECTOR(1,PIC,I2STRT,I2END,IVECT,1,LAST,7,0,0)
      CALL DISPLY(6,IDS,IVECT,1,LAST)
      CALL DISPLY(3,IDL)
      IH=IDS
      IDS=IDL
      IDL=IH
      GO TO 12
	STOP
	END
