% name of textfile: Pxx Starwars Revisited(DL/Synergetics Feb 02 v1.0) % .... % ========= % This file requires the previous download of gonzo.ps % available from http://www.tinaja.com/post01.asp % Make sure the following line agrees with your gonzo.ps location % Use DOUBLE SLASHES anytime you want a single slash in a PS string. (C:\\windows\\desktop\\gonzo\\gonzo.ps) run % use internal gonzo % ========== gonzo begin gutility begin printerror nuisance begin % Rewritten code does the srtarwars transform % 100 100 10 setgrid % 26 17 showgrid % starwars transform is % tilt angle q with 0° = flat and 90° = vertical. % k = fullheight tan(q) % x' = xk/(k + y) % y must go first !! % y' = yk/(k + y) /starwarstransform { /tiltangle 40 def % forward tilt angle /fullheight 134 def % vertical size reference /kk tiltangle tan fullheight mul store % magic numble /ytransform { /yy exch store % must do y transform first yy kk mul kk yy add div } def /xtransform { /xx exch store xx kk mul kk yy add div } def } def starwarstransform % pick the transform here % these procs can be rewritten to do most nonlinear transforms... /movetoproc {moveto} def /linetoproc {lineto} def /curvetoproc {curveto} def /closepathproc {closepath} def % note that the xy transform order varies with the nlt. Starwars needs y first % note that linetoprocs differ when corner cutting is a problem. Starwars does not cut. /movetoproc { 2 copy /lastymt exch store /lasty lastymt store % save close and cp /lastxmt exch store /lastx lastxmt store ytransform exch xtransform exch % y must go first! /moveto cvx} def /linetoproc { /lasty exch store /lastx exch store % save for closepath lasty ytransform lastx xtransform exch /lineto cvx } def /curvetoproc {/y3 exch store /x3 exch store % can use stack roll - nonobvious /y2 exch store /x2 exch store /y1 exch store /x1 exch store /lasty y3 store /lastx x3 store y1 ytransform x1 xtransform exch y2 ytransform x2 xtransform exch y3 ytransform x3 xtransform exch /curveto cvx } def /closepathproc { lastymt ytransform lastxmt xtransform exch /lineto cvx /closepath cvx } def % final close should be zero /remapit { mark {movetoproc} {linetoproc} {curvetoproc} {closepathproc} pathforall ] newpath cvx exec } def /nltshow {false charpath remapit} store /font1 /StoneSans-Bold 35 gonzofont /font1 /Helvetica-Bold 35 gonzofont font1 beige 0.28 settint /pixelproc { -0 0 moveto -111 0 rlineto 0 147 rlineto 222 0 rlineto 0 -147 rlineto closepath remapit gsave 0.85 setgray fill grestore 0.33 setgray 1 setlinewidth stroke /cenadj -98 store cenadj 12 moveto (FREE FONT) nltshow fill cenadj 54 moveto (FREE FONT) nltshow fill cenadj 96 moveto (FREE FONT) nltshow fill } def /drawstarwars {gsave translate pixelproc grestore} def 150 100 drawstarwars showpage % eof