%!PS-Adobe-2.0
%%Creator: R Schlicht
%%Title: sample.ps
%%CreationDate: Fri Feb 10 01:52:07 2006
%%Pages: 1
%%BoundingBox: 0 0 595 842
%%EndComments
%
% Rotating figure with shadow
%
% (c) P. Kleiweg 1997
% http://www.let.rug.nl/~kleiweg/postscript/
%
% (slightly adapted for WinEdt, R Schlicht 2006)
%
%%Page: 1 1

/RString (WinEdt) def

% Don't use multiples of 4
/NumberOfFrames 19 def

% stack in: bool angle
% stack out: -
% if bool eq true then shadow, else upright
/RShadow {
    /RAngle exch def
    {
        % rotate shadow
        [ RAngle cos RAngle sin .3 mul 1.6 .7 0 0 ]
    } {
        % rotate upright figure
        [ RAngle cos RAngle sin .3 mul 0 1 0 0 ]
    } ifelse
    concat
} bind def

% stack in: string
% stack out: string
% point will be adjusted
/center {
    dup
    stringwidth pop
    2 div neg 0 rmoveto
} bind def

/Times-Roman findfont 33 scalefont setfont

/X 80 def
/Y 600 def

0 360 NumberOfFrames div 360 {

    /ThisAngle exch def

    % draw shadow
    gsave
        X Y translate
        .7 .7 .7 setrgbcolor
        true ThisAngle RShadow
        0 0 moveto
        RString center true charpath
        fill
    grestore

    % draw upright figure
    gsave
        X Y translate
        ThisAngle cos 0 gt {
            % front side
            0 0 0 % stroke color
            .8 .0 .8 % fill color
        } {
            % back side
            .5 .5 .5 % stroke color
            .8 .8 .0 % fill color
        } ifelse
        false ThisAngle RShadow
        0 0 moveto
        RString center true charpath
        setrgbcolor fill
        0 0 moveto
        RString center false charpath
        setrgbcolor stroke
    grestore

    % location for next figure
    X 400 gt {
        /X 80 def
        /Y Y 100 sub def
    } {
        /X X 140 add def
    } ifelse

} for

showpage

%%EOF