* Roy Vegard Ovesen -- Wednesday 19 May 2004 22:22:
> http://home.tiscali.no/rvovesen/fuel.png  (19,964 bytes)

Nice! With the MetaPost user number at least doubling within just one day
I'd say that this is now the preferred way to make instrument faces.  ;-) 



> 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. :-)

First of all: I cheated. The "not the best style" statement was for the first
upload, but I consecutively improved the style and uploaded new version. And
then: TMTOWTDI (there's more than one way to do it) and the result counts.
Nothing else. 



> I used polar coordinates to draw the scale lines at desired angles and radii.

So did I. Except ...



> 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.

... for the digits. That's because digits have rectangle shape and can't be
placed evenly. There's some fine control required, and I made use of the
symmetry properties of 0/2/4/6 and 1/5.



> 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.

I have a Makefile that creates the rgb and drops it into the bo's instrument
dir. No intermediate, manual steps. I would have used gimp, though, if "convert"
hadn't produced a decent texture already.

What I would change in your *.mp file, is:

(1) The position and size of the image: the center of the face should IMHO be
    at "origin" (0,0). That's a lot more natural, makes rotations easier, and
    the code easier to read. The canvas should take the later size into account:
    my faces are already 2^n * 2^m in size. No later cropping required,
    only "convert foo.1 foo.png".

(2) I prefer to use relative units. I don't define u in terms of length units
    (1 cm), but such that (0u,0u) is the center, (100u,100u) the upper right
    corner, and (-100u,-100u) the lower left corner.

(2) I'd rather use "(0,10u) rotated i" instead of "(3u+10u*cosd(i),3u+10u*sind(i)"
    (provided that you considered (1). Or even "left scaled 10u rotated i".

(3) The position of 10, 12 and 14. That's why I didn't use polar coordinates
    for that.  ;-)

m.

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

Reply via email to