Jim Wilson wrote:
> With the EFIS displays a lot of the text is what you might call
> "semi static". It doesn't change often, but it changes (autopilot
> settings and nav id's for example). I think the idea of generating
> the quads makes the most sense.
So how about an interface that looks vaguely like (apologies in
advance for getting Plib details wrong -- this is off the top of my
head):
class ssgTextNode : public ssgNode {
void setBaseline(sgVec3 start, sgVec3 end);
void setUp(sgVec3 up, bool correctToPerpendicular = true);
void setPointSize(float lineHeightInMeters);
void setText(char* text);
void setFont(FntFont* font);
void setFntRenderSettings(int AndyForgetsTheDetailsHere, ...);
void draw();
};
You would set the text baseline with a start point, and an "end" point
which lies along the line (not necessarily the end, I suppose). You
need to specify an "up" vector to get the plane and orientation
correct. This can be any point on the plane "above" the baseline. I
added the correctToPerpendicular option so that you can do affine
transformations on the text to simulate italics or whatnot.
The object would precompile its transformation matric and re-compile
only when the baseline/up points change. Likewise, the text string
would be precomputed as an array of quads (this might require some
surgery in the Fnt library to expose the right details) and changed
only when the text does.
Most of this would be pretty straightforward. The geometry code could
be lifted from the 2D-panel-in-3D hack I did (which does basically the
same thing), and the quad synthesis is already done inside the fnt
library; we just need to expose it in the right way.
Andy
_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel