I'm very new at Java3d..

What's the way to go about updating branchgroups and redrawing canvas?

I've a couple of sliders that sets the position of couple of objects in 3d
and user need to click redraw button to redraw the canvas3d.

This is my attempt, I've very little concept of Locale and SimpleUniverse.
So I am not sure if I'm detaching anything important..

     public void actionPerformed(ActionEvent e){
        javax.media.j3d.Locale aLocale = u.getLocale();  // u is
simpleuniverse
        Enumeration bGEnum = aLocale.getAllBranchGraphs();
        u.getCanvas().stopRenderer();
        BranchGroup aBG;
        try{
          while ((aBG = (BranchGroup)bGEnum.nextElement()) != null){
            if (aBG.getCapability(BranchGroup.ALLOW_DETACH))
              aBG.detach();  // detach everything.
         }
        }
        catch(NoSuchElementException except){
        }
        BranchGroup scene;
        scene = aRobot.generateBranchGroup();  // The new scene, already set
capability to detachable
        scene.compile();
        u.addBranchGraph(scene);
        u.getCanvas().startRenderer();
}


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to