NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.
To learn about what's going on, see About the Archive Site.
Bill Hibbard wrote:
To get continuously varying opacity for blending, you need to have a ScalarMap to Alpha rather than a ConstantMap. You'll need to add a RealType to the range values in your Field, and possibly increase the sampling resolution of your Field in the direction you want opacity to vary. Please let me know if that's not clear.
Thanks for the reply, Bill. I see what you are saying regarding ScalarMap vs. ConstantMap transparency. However, perhaps I'm not so concerned with *varying* opacity. The colored wedges that are in the example are Irregular2DSets (not a Field) and are only used to distinguish between one "wedge" (beamwidth) and the next. I would like to illustrate the overlap between these wedges and hoped that by placing one on top of the other, the opacity (or colors) of the overlaping areas would be different than the individual wedge.
--------------------- | Color1 | | | ( # -> Color3 ) | | | ----------------- | |##### | | |##### | | |##### | --------------| | | | | Color2 | -----------------On a different topic, I am trying to use the addReferences(DataRenderer, DataReference[], ConstantMap[][]) method of the DisplayImpl class and have not been successful.
Here is a snippet of my code: allBeamsRend = new DefaultRendererJ3D(); allBeamWidthsRend = new DefaultRendererJ3D(); allBeamFillsRend = new DefaultRendererJ3D(); allBeamLabelsRend = new DefaultRendererJ3D(); public void vcpUpdate() throws VisADException, RemoteException { /* rhiDisplay.removeReference(allBeamsRef); rhiDisplay.removeReference(allBeamWidthsRef); rhiDisplay.removeReference(allBeamFillsRef); rhiDisplay.removeReference(allBeamLabelsRef); */ int NUM_ANGLES = beamPath.getNumElevationAngles(); Gridded2DSet[] paths = beamPath.getBeamPaths(); UnionSet[] widths = beamPath.getBeamWidths(); Irregular2DSet[] fills = beamPath.getBeamFills(); Tuple[] labels = beamPath.getBeamLabels(); allBeamsRef = new DataReferenceImpl[NUM_ANGLES]; allBeamWidthsRef = new DataReferenceImpl[NUM_ANGLES]; allBeamFillsRef = new DataReferenceImpl[NUM_ANGLES]; allBeamLabelsRef = new DataReferenceImpl[NUM_ANGLES]; ConstantMap[][] widthMap = new ConstantMap[NUM_ANGLES][]; ConstantMap[][] fillMap = new ConstantMap[NUM_ANGLES][]; for (int i = 0; i < NUM_ANGLES; i++) { widthMap[i] = new ConstantMap[]{ new ConstantMap(1.0f, Display.Red), new ConstantMap(1.0f, Display.Green), new ConstantMap(( (float)(i*(1/NUM_ANGLES)) ), Display.Blue),new ConstantMap(GraphicsModeControl.DASH_STYLE, Display.LineStyle)};
fillMap[i] = new ConstantMap[]{ new ConstantMap(1.0f, Display.Red), new ConstantMap(1.0f, Display.Green), new ConstantMap(( (float)(i*(1/NUM_ANGLES)) ), Display.Blue), new ConstantMap(0.75f, Display.Alpha)}; allBeamsRef[i] = new DataReferenceImpl("allBeamsRef" + i); allBeamWidthsRef[i] = new DataReferenceImpl("allBeamsRef" + i); allBeamFillsRef[i] = new DataReferenceImpl("allBeamsRef" + i); allBeamLabelsRef[i] = new DataReferenceImpl("allBeamsRef" + i); allBeamsRef[i].setData( paths[i] ); allBeamWidthsRef[i].setData( widths[i] ); allBeamFillsRef[i].setData( fills[i] ); allBeamLabelsRef[i].setData( labels[i] ); } rhiDisplay.addReferences(allBeamsRend, allBeamsRef);rhiDisplay.addReferences(allBeamWidthsRend, allBeamWidthsRef, widthMap);
rhiDisplay.addReferences(allBeamFillsRend, allBeamFillsRef, fillMap); rhiDisplay.addReferences(allBeamLabelsRend, allBeamLabelsRef); } I get the following runtime error:Exception in thread "main" visad.DisplayException: DefaultRendererJ3D.setLinks: must be exactly one DataDisplayLink
and the line number is associated with: rhiDisplay.addReferences(allBeamsRend, allBeamsRef); Thanks for any help you can provide! -kevin. -- +------------------------------------------------------------+ Kevin L. Manross [KD5MYD] <>< (405)-366-0557 CIMMS Research Associate kevin.manross@xxxxxxxx [NSSL-WRDD/SWATN] http://www.cimms.ou.edu/~kmanross "My opinions are my own and not representative of CIMMS, NSSL, NOAA or any affiliates" +------------------------------------------------------------+
visad
archives: