Marcel,
 
You are adding the a child to BranchGroup AFTER you attach it in Simple Universe. This should be BEFORE.
this way:
 
// Second and LAST addChild in the BranchGroup  
        component.addChild(new Sphere (0.2f, new Appearance()));
 
        createSceneLight(component);
 
        Canvas3D canvas3D = new Canvas3D(config);
        panel.add("Center", canvas3D);
 
        simpleU = new SimpleUniverse(canvas3D);
        simpleU.getViewingPlatform().setNominalViewingTransform();
        simpleU.addBranchGraph(component);
//
----- Original Message -----
Sent: Thursday, June 06, 2002 1:33 PM
Subject: [JAVA3D] RestrictedAccessException

Why the  instruction at Test.createCanvasPanel(Test.java:52), generate a RestrictedAccessException
 (javax.media.j3d.RestrictedAccessException: Group: only a BranchGroup node may be added ),
 if the variable component is a BranchGroup ? Why the first addChild(Sphere) don't generate this exception ?
 I just try to add a new child to a BranchGroup.
How I can modify a BranchGroup after it has been added to a Universe ?
I sent you the source code of my test.
 
Marcel Almeida

Reply via email to