147

Grouping shapes
BranchGroup example code

  • Build a locale in a universe
    Locale myLocale = new Locale( myUniverse );

  • Build a shape
    Shape3D myShape = new Shape3D( myGeom, myAppear );

  • Add the shape to a branch group
    BranchGroup myBranch = new BranchGroup( );
    myBranch.addChild( myShape );

  • Add the branch group to the locale
    myLocale.addBranchGraph( myBranch );