Re: Delaunay and Java3D

> sure I can Display the results with VisAD, but unfortunately that is not
> what I want, because I want to use my own "Display"-classes.
> I need to put the 3D-object-content in my class "Layer3D.java" which is
> waiting for a Shape3D or a BranchGroup or a TransformGroup from Java3D.
> Due to your previous mail I got the idea, maybe I could use the
> Java3D-scenegraph produced from VisAD.
> So i tried to track down the VisAD-BranchGroup the following way:
> . . .
> And which of the methods in DisplayRendererJ3D (which are all not
> commented) would be the right one to get the 3D-content of the Java3D
> scenegraph and not the content of the ViewBranchGraph.
> 
> Ok , I know that is probably not for what VisAD was developed:
> "VisAD shields applications developers from details of graphics APIs. Thus
> for most applications, the only
> difference between Java3D and Java2D displays is whether they are
> constructed with DisplayImplJ3D or
> DisplayImplJ2D, and the constraint that Java2D displays cannot involve
> ScalarMaps to ZAxis, Latitude or Alpha."
> 
> But is it possible or are there any alternatives?

Wonderful Desiree.  VisAD will shield you if you like, but
hopefully also will let you dig as deep as you like.  Please
try this:

  DataReferenceImpl terrain_ref = new DataReferenceImpl("terrain");
  terrain_ref.setData(terrain);
  DefaultRendererJ3D renderer = new DefaultRendererJ3D();
  display.addReferences(renderer, terrain_ref);

  DisplayListener listener = new YourDisplayListenerClass();
  display.addDisplayListener(listener);

Then in the displayChanged() method of listener:

  if (e.getId() == DisplayEvent.TRANSFORM_DONE) {
    BranchGroup branch = renderer.getBranch();
    // now the Shape3D you want is the child or
    // grandchild or greatgrandchild of branch
    // (I'm not sure which offhand)
    //
    // you can't re-use that Shape3D unless you
    // invoke branch.detach() to take it out of
    // the live Java3D scenegraph
  }

Please let me know if you have any questions or problems.

Cheers,
Bill
----------------------------------------------------------
Bill Hibbard, SSEC, 1225 W. Dayton St., Madison, WI  53706
hibbard@xxxxxxxxxxxxxxxxx  608-263-4427  fax: 608-263-6738
http://www.ssec.wisc.edu/~billh/vis.html


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