[comp.lang.postscript] Transpose Question

t-dougls@microsoft.UUCP (Douglas Strauss) (02/09/90)

I have just started to muck around with some postscript and wondering
how the values of the transpose function are intpreted.  On the apple
laserwriter I am using:
90 rotate
0 -617 translate
Or pretty close to this right our the the RGB books.  What do these values
for the translate refer to?  I would assume that it is the largest print area
on the laser writer or something like that.

Could somebody clarify this for me please.  I shall then stick to mostly
reading and learn.  Thanks.

Doug Strauss

fsfacca@avelon.lerc.nasa.gov (Tony Facca) (02/15/90)

In article <10519@microsoft.UUCP> t-dougls@microsoft.UUCP (Douglas Strauss) writes:
>I have just started to muck around with some postscript and wondering
>how the values of the transpose function are intpreted.  On the apple
>laserwriter I am using:
>90 rotate
>0 -617 translate
>Or pretty close to this right our the the RGB books.  What do these values
>for the translate refer to?  I would assume that it is the largest print area
>on the laser writer or something like that.
>
>Could somebody clarify this for me please.  I shall then stick to mostly
>reading and learn.  Thanks.
>

The translate command is used to transform what Adobe defines as the Current
Transformation Matrix.  The command, "Tx Ty translate" with no specified
matrix, will do a matrix multiplication T x CTM (where T is a 3x3 matrix as
described in the Red book) and push a new CTM onto the operand stack.

The reason for a 0 -617 translation is most likely to reposition the origin 
after a 90 degree rotation.  You should look at the Red book (section 4.4)
if you still don't get it.
--
-----------------------------------------------------------------------------
Tony Facca                     |     phone: 216-433-8318
NASA Lewis Research Center     |    
Cleveland, Ohio  44135         |     email: fsfacca@lerc08.lerc.nasa.gov 
-----------------------------------------------------------------------------

jlw@lzga.ATT.COM (Joe Wood) (02/15/90)

In article <1990Feb14.174304.26351@eagle.lerc.nasa.gov> fsfacca@avelon.UUCP (Tony Facca) writes:
>In article <10519@microsoft.UUCP> t-dougls@microsoft.UUCP (Douglas Strauss) writes:
>>I have just started to muck around with some postscript and wondering
>>how the values of the transpose function are intpreted.  On the apple
>>laserwriter I am using:
>>90 rotate
>>0 -617 translate


In simpler terms think of it this way.  Take two 8.5"x11" sheets
of paper one on top of the other with the long edge up and down.
Think of drawing you image on the top sheet with the origin in the
lower left hand corner and the X direction increasing to the right
and the Y direction increasing upward.  Grab both sheets by the
thumb and forefinger of the left hand at the lower left corner
of the two sheets.  Now turn the top sheet only 90 degrees to
the left (counter-clockwise).  The printing surface is still
where the lower unmoved sheet is.  Therefore, to move the
image back onto the paper you must shift it to the right about
the width of a sheet of paper in PostScript units ~8.5"x72= ~617.
Since you rotated your frame of reference this is now in the
negative Y direction and <NOT> in the X direction.  After all this
you're ready to draw in what is essentially LandScape mode.

Hope this helps.
Joe Wood
jlw@lzga.ATT.COM

ttl@astroatc.UUCP (Tony Laundrie) (02/19/90)

In article <1990Feb14.174304.26351@eagle.lerc.nasa.gov> fsfacca@avelon.UUCP (Tony Facca) writes:
>In article <10519@microsoft.UUCP> t-dougls@microsoft.UUCP (Douglas Strauss) writes:
>>I have just started to muck around with some postscript...
>>90 rotate
>>0 -617 translate
>>...What do these values for the translate refer to?
>
>The translate command is used to transform what Adobe defines as the Current
>Transformation Matrix.  The command, "Tx Ty translate" with no specified
>matrix, will do a matrix multiplication T x CTM (where T is a 3x3 matrix as
>described in the Red book) and push a new CTM onto the operand stack.
>

Let's not scare the guy away with mathematics!  When the PostScript printer
is in it initial state, the origin is in the lower left corner of an
8.5 x 11 inch page.  90 rotate means "hold your finger on the origin and
spin the piece of paper clockwise 90 degrees."  The effect will make
the origin be in the upper left corner of an 11 x 8.5 inch page.

0 -612 translate means "move the origin (for all future coordinate
references) to coordinate (0,-612).  Since the initial units for PostScript
are points, of which there are 72 per inch, the effect of "0 -617 translate"
is to move the origin down 8.0 inches, placing it in the lower left corner
of that 11 x 8.5 inch page.