[comp.text.tex] MF rotatedabout

windley@cheetah.cs.uidaho.edu (Phil Windley/20000000) (12/08/90)

I'm new to Metafont and I'm trying to make a character that is based on a
pentagon.  I want to be abla to make a currentpicture representing one of
the 5 regular parts and then say something like:

currentpicture := currentpicture transformed t1;

where 

t1 = rotatedabout ((.5w,.5h),72);

but I get an error message that says:

! That transformation is too hard.
<to be read again> 


Why is it too hard.  It only seems to work if I give it even 90 degree
rotations.  

--phil--

--
Phil Windley                          |  windley@cheetah.cs.uidaho.edu
Assistant Professor		      |  windley@cs.uidaho.edu
Department of Computer Science        |
University of Idaho                   |  Phone: 208.885.6501  
Moscow, ID 83843                      |  Fax:   208.885.6645

jg@prg.ox.ac.uk (Jeremy Gibbons) (12/10/90)

> I want to be abla to make a currentpicture representing one of
> the 5 regular parts and then say something like:

> currentpicture := currentpicture transformed t1;

> where 

> t1 = rotatedabout ((.5w,.5h),72);

> but I get an error message that says:

> ! That transformation is too hard.
> <to be read again> 


> Why is it too hard.  It only seems to work if I give it even 90 degree
> rotations.  

MFBook, p144 (in the index under `picture expressions, transformation of'):
[pictures can only be rotated by multiples of 90 degrees, and scaled and
shifted by integers] ``otherwise the transformation would not take pixel
boundaries to pixel boundaries''.

Rotation and arbitrary scaling of bitmaps is not easy. (You could say, by the
time the drawing primitives have been `compiled' to bitmaps, you've lost the
necessary information.) You're better off rotating the elements (paths etc)
*before* drawing them: instead of

   draw p;
   addto currentpicture also currentpicture transformed t;

use

   draw p;
   draw p transformed t;

In your case, you can define a macro `drawfivetimes' that will draw something
five times, once per orientation.

*-----------------------------------------------------------------------*
|  Jeremy Gibbons (jg@uk.ac.oxford.prg)   Funky Monkey Multimedia Corp  |
*-----------------------------------------------------------------------*