[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] Perspective in Pic

From: Werner LEMBERG
Subject: Re: [Groff] Perspective in Pic
Date: Wed, 18 Oct 2006 12:57:08 +0200 (CEST)

> Now you'll see that it gives a perspective picture of
> a box with "Contents" on the top, "of" on the left-hand
> side, and "the box" on the facing side. [...]

> But it has occurred to me that it would have been much easier if it
> were possible to
> a) First construct an object as if you were looking at it at right
>    angles. E.g. for the top face of the box,
>    box wid l1 ht l2 with .sw at (0,0)
>    line invis from last box .w to last box .e \
>      "\f[HB]\s[24]Contents\s0\fP" aligned
> b) Wrap this in a function which would, given the coordinates of the
>    "viewpoint" (i.e. where the eye is), output the perspective
>    drawing of it.
> This could then be applied to all three visible faces.

I don't think this will ever be possible with pic.  It's not suited to
3D manipulations.

> At the other end of the tube, even if you have an object defined in
> PostScript code, I doubt you can write a PostScript function to
> apply a perspective transformation to a general object, since the
> transformation is non-linear.  This would particularly apply to any
> text. (though, locally, you can approximate it linearly, but then
> you have to explicitly know where you are).

You might have a look at the pstricks package for LaTeX, in particular
the `pst-3d' and `pst-vue3d' bundle -- this is *very* impressive
stuff.  Something similar could be written for groff.

> I'm wondering of there is a general approach at all, within the
> world of groff/PostScript.

An alternative is the use of `featpost' package for MetaPost.
Yesterday I've tested it with MetaPost's troff output mode, using my
`groffmp' bundle to postprocess the output, and it seems to work (more
or less; it uses some hard-coded TeX fonts for labeling).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]