This site is currently read-only as we are migrating to Oracle Forums for an improved community experience. You will not be able to initiate activity until January 31st, when you will be able to use this site as normal.

    Forum Stats

  • 3,890,899 Users
  • 2,269,649 Discussions


adding BranchGroup after compile() : live objects

843799 Member Posts: 49,999
edited Jan 4, 2002 5:24PM in Java 3D

after compile() my objRoot (BranchGroup), i detached some children and attached new ones with picking. but when i try to pick the new child object, i got these error messages.

Exception occurred during Behavior execution:
java.lang.IllegalStateException: Picking can only work if BranchGroup is alive

the code is as follows.

class MyClass ...
SimpleUniverse su;
su = ...;
public void createBranchGroup()
objRoot.addChild(new myBranchGroup(su));

class myBranchGroup extends BranchGroup(SimpleUniverse su)
TransformGroup trans = new TransformGroup();

PickTranslateBehavior pick = new PickTranslateBehavior(this, new Canvas3D (SimpleUniverse.getPreferredConfiguration()), new BoundingBox() );

i setup needed capability bits (CHILDREN_READ, CHILDREN_WRITE, ENABLE_PICK_REPORTING, etc). but this code generate the error before. how can i add a child with picking? or how can i add a child that is alive?


This discussion has been closed.