[Date Prev][Date Next] [Chronological] [Thread] [Top]

ScreenLockedRendererJ3D() (fwd)



This is such a natural question for visad-renderer, that
I am taking the liberty of forwarding it.

---------- Forwarded message ----------
Date: Mon, 19 May 2003 16:56:00 -0600
From: Don Murray <dmurray@unidata.ucar.edu>
To: jimk@bom.gov.au
Cc: Bill Hibbard <billh@ssec.wisc.edu>
Subject: ScreenLockedRendererJ3D()

Hi Jim-

You've been doing some great work in VisAD and I'm trying
to use it as much as possible.  I'm working with your
SignalStrengthScale example that you sent out recently
to add in color scales to the displays of our IDV.

What I'd like to do is make these screen locked, so I
was looking at your ScreenLockedRenderer which handles
text.  I'm wondering if this could be adapted to handle
shapes as well, or if it would need to be a different
class?

I don't know anything about DataRenderers, but it looks
like in your ShadowScreenLocked* classes, you've overridden
addTextToGroup to add in the transform group that holds the
text.  It seems like to do this for shapes, one would have
to override addToGroup somehow to add in the transform group.
What I tried was overriding addToGroup in the ScreenLockedRenderer
to be:

   public boolean addToGroup(Object group, VisADGeometryArray geomArray,
     GraphicsModeControl control, float alpha, float [] color)
     throws VisADException
   {
     ((Group) group).addChild(transformGroup);
     return super.addToGroup(transformGroup, geomArray, control, alpha,
       color);
   }

This kept the main in ScreenLockedRenderer working fine.
For the shape, it almost worked.  Zooming in and zooming out
kept the color bar (i haven't added labels) in the same place.
Rotating the cube caused the color bar to jump around, presumably
because the transforms for line arrays are different from
triangle arrays.

Do you have any suggestions on how I might get this to work?

Thanks in advance.

Don
*************************************************************
Don Murray                               UCAR Unidata Program
dmurray@unidata.ucar.edu                        P.O. Box 3000
(303) 497-8628                              Boulder, CO 80307
http://www.unidata.ucar.edu/staff/donm
*************************************************************