Re: Plane in which text presented in 3D

Hi Charles,

> Text placement in 3D is done in the X-Y plane by default
> and there seems to be no obvious mechanism by which it could
> be placed otherwise. We are designing a display in which
> the initial presentation will be altitude up-down in
> the screen plane and latitude perpendicular to the screen,
> contrary to all the VisAD coding examples.
> We accomplish this by associating altitude with Display.ZAxis,
> as is typical in the coding examples. Then we use a
> ProjectionControl to rotate the DisplayImpl object. But then
> of course, the text we placed in it (after studying Test45
> of the examples) is lying down...
> The workaround seems to be to assign Latitude to
> Display.ZAxis and Altitude to Display.YAxis and not
> make an initial rotation. But this seems to be a dangerous
> departure from the conventions of VisAD in that much of
> its power appears to derive from adhering to said conventions.
> What to do?

I think it would be worth a try to map Latitude to ZAxis
and Altitude to YAxis, and see if that works for you. It
could be an easy way around your problem.

The TextControl.setRotation() method only controls text
angle in the X-Y plane, and we haven't had occasion to put
more general text angle control in TextControl.

However, you can accomplish the same thing by putting all
your text Strings into a ShapeConrol. You convert Strings
to shapes using the method of visad/

  public static VisADLineArray render_label(String str, double[] start,
         double[] base, double[] up, boolean center);

where start is the 3-vector start location for the text, base
is a 3-vector along the text reading direction, up is a 3-vector
along the font risers, and center is true to indicate that the
text is centered at the start position. You can use this for
arbitrary text orientation.

I would try the alternate mappings first, because its simple,
and only resort to using Shape if the mappings don't work.

Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI  53706
hibbard@xxxxxxxxxxxxxxxxx  608-263-4427  fax: 608-263-6738