          SUBROUTINE SYSM(ICHNG)
          DIMENSION OBJ(6,100),MOD(2,5)
          COMMON/BULK/I3STRT,I3END,O(6,100)
          COMMON/PAINT/I2STRT,I2END,P(4,100)
          COMMON/LIMITS/XMIN,XMAX,YMIN,YMAX
          COMMON/OIL/IVECT(200)
          COMMON/GRXPQK/S11,S12,S13,S21,S22,S23,S31,S32,S33,
	9T11,T21,T31
          COMMON/EYCEP/EYE(3),CEN(3),UP(3)
          COMMON/SYSTEM/E1(3),C1(3),U1(3)
          COMMON/VIEWER/E2(3),C2(3),U2(3)
          COMMON/SLIMS/X1MIN,X1MAX,Y1MIN,Y1MAX
          COMMON/VLIMS/X2MIN,X2MAX,Y2MIN,Y2MAX
          COMMON/DISTS/DIST1,DIST2
          IF(ICHNG.EQ.0)GO TO 800
          IF(ICHNG.GT.1)GO TO 1000
          DO 1 I=1,3
          EYE(I)=E1(I)
          CEN(I)=C1(I)
          UP(I)=U1(I)
1         CONTINUE
          XMIN=X1MIN
          XMAX=X1MAX
          YMIN=Y1MIN
          YMAX=Y1MAX
          DIST=DIST1
          CALL ROTER
C
C         PUT IN BORDER AND EYE
C
          OBJ(1,1)=XMAX
          OBJ(2,1)=YMIN
          OBJ(3,1)=DIST
          OBJ(1,2)=XMAX
          OBJ(2,2)=YMAX
          OBJ(3,2)=DIST
          OBJ(1,3)=XMIN
          OBJ(2,3)=YMAX
          OBJ(3,3)=DIST
          OBJ(1,4)=XMIN
          OBJ(2,4)=YMIN
          OBJ(3,4)=DIST
C
          DO 2 K=1,4
          KK=K+1
          IF(KK.EQ.5)KK=1
          DO 2 I=4,6
          J=I-3
2         OBJ(I,K)=OBJ(J,KK)
C
C         SIZ=EYE SIZE
C
          SIZ=(XMAX-XMIN)/22.
          ANG=-40.
          RD=3.14159/180.
C
          DO 3 K=5,13
          ANG=ANG+40.
          OBJ(1,K)=COS(ANG*RD)*SIZ
          OBJ(2,K)=SIN(ANG*RD)*SIZ
3         OBJ(3,K)=0.
C
          DO 4 K=5,13
          KK=K+1
          IF(KK.EQ.14)KK=5
          DO 4 I=4,6
          J=I-3
4         OBJ(I,K)=OBJ(J,KK)
C
C   NOW GET PROJECTION OF OBJECT
C
          I3STRT=MOD(1,4)
          I3END=MOD(2,4)
          I2STRT=I3STRT
          I2END=I3END
C
          CALL MAPPER(DIST)
C   PUT IN Z=DIST THEN INTO OBJ(6,200)
C
          DO 5 I=I3STRT,I3END
          II=I-NLNS
          OBJ(1,II)=P(1,I)
          OBJ(2,II)=P(2,I)
          OBJ(3,II)=DIST
          OBJ(4,II)=P(3,I)
          OBJ(5,II)=P(4,I)
5         OBJ(6,II)=DIST
C
C   NOW DO REVERSE TRANSFORMATION
C
          IS=1
          IE=MOD(2,3)
          DO 7 I=IS,IE
          O(1,I)=S11*OBJ(1,I)+S21*OBJ(2,I)+S31*OBJ(3,I)+EYE(1)
          O(2,I)=S12*OBJ(1,I)+S22*OBJ(2,I)+S32*OBJ(3,I)+EYE(2)
          O(3,I)=S13*OBJ(1,I)+S23*OBJ(2,I)+S33*OBJ(3,I)+EYE(3)
          O(4,I)=S11*OBJ(4,I)+S21*OBJ(5,I)+S31*OBJ(6,I)+EYE(1)
          O(5,I)=S12*OBJ(4,I)+S22*OBJ(5,I)+S32*OBJ(6,I)+EYE(2)
7         O(6,I)=S13*OBJ(4,I)+S23*OBJ(5,I)+S33*OBJ(6,I)+EYE(3)
C
C   NOW PROJECTION LINES
C
C
          IS=MOD(1,5)
          IE=MOD(2,5)
          DO 9 J=IS,IE
          DO 9 I=1,3
9         O(I,J)=E1(I)
C
1000      DO 1001 I=1,3
          EYE(I)=E2(I)
          CEN(I)=C2(I)
          UP(I)=U2(I)
1001      CONTINUE
          XMIN=X2MIN
          XMAX=X2MAX
          YMIN=Y2MIN
          YMAX=Y2MAX
          DIST=DIST2
          DO 10 I=1,5
          I3STRT=MOD(1,I)
          I3END=MOD(2,I)
          I2STRT=I3STRT
          I2END=I3END
          CALL ROTER
          CALL MAPPER(DIST)
          ISC=0
          INT=6
          IF(I.EQ.5)INT=3
          IF(I.EQ.5)ISC=1
          CALL VECTOR(1,P,I2STRT,I2END,IVECT,1,LAST,INT,ISC,-1)
10        CALL DISPLY(1,I,IVECT,1,LAST)
          RETURN
800       READ(5,500)NLNS
500       FORMAT(I5)
          IS=NLNS+14
          IE=IS+NLNS-1
          READ(5,501)((O(I,J),I=1,6),J=IS,IE)
501       FORMAT(6F5.1)
          MOD(1,4)=IS
          MOD(2,4)=IE
          READ(5,500)NPTS
          IS=2*NLNS+14
          IE=IS+NPTS-1
          READ(5,502)((O(I,J),I=4,6),J=IS,IE)
502       FORMAT(3F5.1)
C
C
          MOD(1,5)=IS
          MOD(2,5)=IE
          MOD(1,1)=1
          MOD(2,1)=4
          MOD(1,2)=5
          MOD(2,2)=13
          MOD(1,3)=14
          MOD(2,3)=NLNS+13
          RETURN
          END
