Roy Vegard Ovesen wrote:
On Tuesday 18 May 2004 19:09, Melchior FRANZ wrote:

Andy has once posted a method to create instrument scales using Perl to
output PostScript commands. While I like Perl, I'm not good at PS, so I
tried an alternate approach: MetaPost.

MetaPost is a spin-off of MetaFont, which was designed to create the fonts
for TeX. Is comes with typical TeX installations and should be available on
any Linux/Unix workstation.

Here's a small MetaPost file that I used to make the Bo105 rotor tacho
(which is totally made up; need some expert advice first):

 http://members.aon.at/mfranz/tach.mp  (1.9kB)

It's still quite trivial and does only use a tiny fraction of MetaPost's
possibilities. Also, it's not the best coding style yet. I'll probably make
a library with common functions (like "arc") as I see need. MetaPost
creates PostScript files, that I converted to png/rgb using "convert"/rle:

http://members.aon.at/mfranz/tach.png (23kB)


I also used MetaPost to create an instrument face for the fuel gauge of a King Air 200.

http://home.tiscali.no/rvovesen/fuel.png  (19,964 bytes)

http://home.tiscali.no/rvovesen/rose.mp

If your example is "not the best coding style" then I would say that mine is probably _the_ worst coding style. :-)

Note that the fuel gauge starts at beginfig(2). Figure 1 is a compass rose. I used polar coordinates to draw the scale lines at desired angles and radii. I also used polar coordinates to place the numbers at the exact same angles as the lines. It looks to me like you have carefully chosen the cartesian coordinates to place the number labels at.

I opened the postscript file with Gimp. Upon opening, one can select the resolution (DPI) and the amount of anti-aliasing of graphics and text separately.

Ok, this stuff looks really cool, but I am encountering a pretty steep learning curve with MetaPost. Does someone out there want to cook up a generic template with plug-in values for all the variables and enough documentation that someone can just pick it up and go? I know, I'm needy.

Josh


_______________________________________________ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to