Hello,
if your scenegraph is alive you can only add BranchGroup-nodes.
So, add the Background-node to an non-living BranchGroupNode. Finally
add the BranchGroup-node to your root-node.
-----------------------
      Background background = new Background(0f, 0f, 0f);

      BranchGroup backgroundBg = new BranchGroup();
      backgroundBg.addChild(background);

      rootBg.addChild(backgroundBg);
----------------------

   Peter
 

Bob Gray schrieb:

 

In my application, I use SimpleUniverse and I create an empty BranchGroup to which I will add all my scene objects and behaviuors after the scene is live.

When everything goes live, the BranchGroup is empty.

I then try to add a Background to the BranchGroup, but I get the error:

"javax.media.j3d.RestrictedAccessException: Group: only a BranchGroup node may be added"

I do have the ALLOW_CHILDREN_EXTEND capability set on the BranchGroup.

I can add objects (other BranchGroups) to the initial BG, but not the Background.

Can anyone explain to me what the problem is?

Bob Gray

Reply via email to