Add TransformGroup to VisAD

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


  • 2001 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: