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.
<html><div style='background-color:'><DIV>Hi, All</DIV> <DIV> </DIV> <DIV>Sorry for asking this question again. I followed instructions from Bill and Don, and I used the following code (partial list) to draw some texts.</DIV> <DIV> </DIV> <DIV>RealType shape = new RealType("shape");<BR>ScalarMap shape_map = new ScalarMap(shape, Display.Shape);<BR>display.addMap(shape_map);</DIV> <DIV> </DIV> <DIV>RealTupleType coord_type = new RealTupleType(longitude,latitude,elevation,shape);</DIV> <DIV> </DIV> <DIV> double[] start = {0.0, 0.0, 0.0};<BR> double[] base = {0.3, 0.0, 0.0}; <BR> double[] up = {0.0, 0.3, 0.0};<BR> boolean center = false;<BR> <BR> PlotText pt = new PlotText();</DIV> <DIV> </DIV> <DIV> VisADLineArray shape1 = pt.render_label("My text is here", start, base, up, center);</DIV> <DIV>//shape2</DIV> <DIV>//shape3</DIV> <DIV> VisADGeometryArray[] shapes = new VisADGeometryArray[] {shape1,shape2,shape3};</DIV> <DIV> ShapeControl shape_control = (ShapeControl) shape_map.getControl();<BR> shape_control.setScale(0.2f);<BR> shape_control.setShapeSet(new Integer1DSet(3));<BR> shape_control.setShapes(shapes);</DIV> <DIV> </DIV> <DIV>I also used the following code to specify the location for the text and add the shapes to display:</DIV> <DIV> </DIV> <DIV>RealTuple coord_tuple = new RealTuple(coord_type, new double[] {samp2[0][0],samp2[1][0],fResult2[0],0});</DIV> <DIV>DataReferenceImpl ref_coord_tuple = new DataReferenceImpl("ref_coord_tuple");<BR>ref_coord_tuple.setData(coord_tuple);<BR>display.addReference(ref_coord_tuple,streetColor);</DIV> <DIV> </DIV> <DIV>The code worked for me. The text is displayed at the given location (in this case, samp2[0][0],samp2[1][0],fResult2[0])as we can see from Test 45 and Test 69, i.e., the text is dsiplayed parallel to x-axis and I can read it as output from any System.out.println.</DIV> <DIV> </DIV> <DIV>Now, I want to display the text with any specific angles to x, y and z axis. for example, I want to display text with 50 degrees to x-axis, 100 degrees to y-axis, and 260 degrees to z-axis. I do not know how to set start, base and up in this case. </DIV> <DIV> </DIV> <DIV>Thanks a lot.</DIV> <DIV> </DIV> <DIV>Gaoming Fu </DIV></div><br clear=all><hr>Get your FREE download of MSN Explorer at <a href='http://go.msn.com/bql/hmtag_itl_EN.asp'>http://explorer.msn.com</a><br></html>
visad
archives: