<html><div style='background-color:'><DIV>
<P>Hi, Bill:</P>
<P>Thank you very much for your help.</P>
<P>I tried the following in my class:</P>
<P>DisplayRendererJ3D dr =
(DisplayRendererJ3D)display.getDisplayRenderer();<BR>TransformGroup tg =
dr.getTrans();<BR>tg.addChild(myTransformGroup);</P>
<P>Because display.getDisplayRenderer() will only return DisplayRenderer, so I
casted it to</P>
<P>DisplayRendererJ3D. The class compiled well, but I got a runtime error:
javax.media.j3d.RestrictedAccessException: Group: only a BranchGroup node may
be added.</P>
<P>I also tried the following:</P>
<P> DisplayRendererJ3D dr =
(DisplayRendererJ3D)display.getDisplayRenderer();<BR> BranchGroup
bg = dr.getRoot();<BR> bg.addChild(myTransformGroup);</P>
<P>I got the same runtime error.</P>
<P>Please advise. Thanks a lot.</P>
<P>Gaoming</P>
<P><BR><BR><BR> </P></DIV>
<DIV></DIV>
<DIV></DIV>>From: Bill Hibbard <HIBBARD@xxxxxxxxxxxxxxxxx>
<DIV></DIV>>To: gaoming fu <GAOMING_FU@xxxxxxxxxxx>
<DIV></DIV>>CC: visad-list@xxxxxxxxxxxxx
<DIV></DIV>>Subject: Re: Irregular2DSet and contour lines
<DIV></DIV>>Date: Thu, 29 Nov 2001 06:15:02 -0600
<DIV></DIV>>
<DIV></DIV>>Hi Gaoming,
<DIV></DIV>>
<DIV></DIV>> > 1. I used Irregular2DSet to draw the following data.
<DIV></DIV>> >
<DIV></DIV>> > 4.0f 3.2f 9.0f
<DIV></DIV>> > 5.4f 4.0f 9.0f
<DIV></DIV>> > 4.0f 5.3f 9.0f
<DIV></DIV>> > 3.2f 4.0f 9.0f
<DIV></DIV>> > 4.0f 2.0f 8.0f
<DIV></DIV>> > 6.0f 3.0f 8.0f
<DIV></DIV>> > 6.0f 4.0f 8.0f
<DIV></DIV>> > 5.0f 5.0f 8.0f
<DIV></DIV>> > 4.0f 6.0f 8.0f
<DIV></DIV>> > 3.0f 6.0f 8.0f
<DIV></DIV>> > 2.0f 5.0f 8.0f
<DIV></DIV>> > 2.0f 4.0f 8.0f
<DIV></DIV>> > 2.0f 4.0f 4.0f
<DIV></DIV>> > 4.0f 2.0f 4.0f
<DIV></DIV>> > 6.0f 3.0f 4.0f
<DIV></DIV>> > 6.0f 4.0f 4.0f
<DIV></DIV>> > 5.0f 5.0f 4.0f
<DIV></DIV>> > 4.0f 6.0f 4.0f
<DIV></DIV>> > 3.0f 6.0f 4.0f
<DIV></DIV>> > 2.0f 5.0f 4.0f
<DIV></DIV>> >
<DIV></DIV>> > I can not see any points with z values of 4.0, i.e., there
is no surface drawn between
<DIV></DIV>> > points with z value of 4.0 and points with z values of 8.0
and 9.0. But all the points can
<DIV></DIV>> > be seen in the point mode. Please note that points with z
values of 4.0 have the same
<DIV></DIV>> > x and y values as points with z values of 8.0.
<DIV></DIV>>
<DIV></DIV>>If you are constructing an Irregular2DSet, then you must be
<DIV></DIV>>representing your data as a FlatField with a 2-D domain and
<DIV></DIV>>MathType ((x, y) -> z). But if you have different z values
<DIV></DIV>>(4.0 and 8.0) at the same (x, y) locations, then z is not a
<DIV></DIV>>function of (x, y). If you are passing all your (x, y) locations
<DIV></DIV>>to the Irregular2DSet constructor, some of them will be
<DIV></DIV>>identical, which will cause trouble in the implicit call to
<DIV></DIV>>the Delaunay constructor.
<DIV></DIV>>
<DIV></DIV>>Because z is not a function of (x, y) you probably shouldn't
<DIV></DIV>>try to depict your data as a functional surface. You might
<DIV></DIV>>partition your data, so that the points in each partition
<DIV></DIV>>do define a function relation ((x, y) -> z), then depict
<DIV></DIV>>your data as multiple surfaces, one for each partition.
<DIV></DIV>>
<DIV></DIV>> > 2. I want to draw 3D surface together with contour lines
and the contour line should be
<DIV></DIV>> > labeled with elevation.
<DIV></DIV>>
<DIV></DIV>>You can construct ScalarMaps of z to ZAxis and to IsoContour.
<DIV></DIV>>However, 2-D contour labeling currently only works for
<DIV></DIV>>GriddedSets, so you will need to resample to a grid to get
<DIV></DIV>>labels. A high resolution grid will be the most faithful
<DIV></DIV>>to your original data.
<DIV></DIV>>
<DIV></DIV>> > 3. Can I add my own TransformGroup (i.e., built from
java3d,without
<DIV></DIV>> > using any VisAD) to DisplayImplJ3D in a class built using
VisAD, and then draw it together with any other data processed using VisAD, in
the
<DIV></DIV>> > same Coordinate system?
<DIV></DIV>>
<DIV></DIV>>Yes. Try:
<DIV></DIV>>
<DIV></DIV>> DisplayRendererJ3D dr = display.getDisplayRenderer();
<DIV></DIV>> TransformGroup tg = dr.getTrans();
<DIV></DIV>>
<DIV></DIV>>Now you can add your own TransformGroup under tg. Note
<DIV></DIV>>that the Transform3D in tg is controlled by the VisAD
<DIV></DIV>>ProjectionControl and mouse rotate, translate and zoom.
<DIV></DIV>>If you want to add your TransformGroup above this, then
<DIV></DIV>>add them to the BranchGroup:
<DIV></DIV>>
<DIV></DIV>> BranchGroup bg = dr.getRoot();
<DIV></DIV>>
<DIV></DIV>>Good luck,
<DIV></DIV>>Bill
<DIV></DIV>>----------------------------------------------------------
<DIV></DIV>>Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI 53706
<DIV></DIV>>hibbard@xxxxxxxxxxxxxxxxx 608-263-4427 fax: 608-263-6738
<DIV></DIV>>http://www.ssec.wisc.edu/~billh/vis.html
<DIV></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>