C  SUBROUTINE TO MAP AN OBJECT FILE ON TO A PICTURE PLANE
C  USING MATRICES CALCULATED FROM SUBROUTINE ROTER
C
          SUBROUTINE MAPPER(DIST)
	LOGICAL SWITCH, FIRST
          COMMON/GRXPQK/S11,S12,S13,S21,S22,S23,S31,S32,S33,T11,
	9T21,T31
          COMMON/BULK/I3STRT,I3END,OBJECT(3,60)
          COMMON/PAINT/I2STRT,I2END,PICT(2,60)
C 
C  CALCULATE ROTATED POINTS FROM OBJECT AND PLACE IN PICT
	SWITCH = .TRUE.
	FIRST = .TRUE.
          JJ=I2STRT*2-1
          ISTRT=I3STRT*2-1
          IEND=I3END*2
          DO 100 J=ISTRT,IEND
          TEMPX=OBJECT(1,J)*S11+OBJECT(2,J)*S12+OBJECT(3,J)
	9*S13+T11
          TEMPY=OBJECT(1,J)*S21+OBJECT(2,J)*S22+OBJECT(3,J)*
	9S23+T21
          TEMPZ=OBJECT(1,J)*S31+OBJECT(2,J)*S32+OBJECT(3,J)*
	9S33+T31
C
C  GET VALUE IN PICTURE PLANE BY USING RATIO OF DISTANCES IN
C  Z DIRECTION (DISTANCE FROM EYE POINT TO PICTURE PLANE)
C
	IF (TEMPZ) 1,5,3
5	TEMPZ = 1.E76/AMAX1(ABS(TEMPX),ABS(TEMPY))
	GO TO 3
1	SWITCH = .FALSE.
3	TEMPZ=DIST/TEMPZ
          PICT(1,JJ)=TEMPX*TEMPZ
	PICT(2,JJ)=TEMPY*TEMPZ
	IF (SWITCH.AND.FIRST) GO TO 100
	IF ((J/2)*2.EQ.J) GO TO 2
	FIRST = .FALSE.
	GO TO 99
2	K = JJ
	I = JJ-1
	IF (FIRST) GO TO 6
	K = I
	I = JJ
	IF (SWITCH) GO TO 6
	JJ = JJ-2
	GO TO 98
6	TEMPX = PICT(1,I) - PICT(1,K)
	TEMPY = PICT(2,I) - PICT(2,K)
	TEMPZ = 1.E76/AMAX1(ABS(TEMPX),ABS(TEMPY))
	PICT(1,K) = TEMPX * TEMPZ
	PICT(2,K) = TEMPY * TEMPZ
98	FIRST = .TRUE.
99	SWITCH = .TRUE.
100       JJ=JJ+1
          I2END=JJ/2
          RETURN
          END
