I'm trying to add another light source . However, for the following
code, I got error message
"javax.media.j3d.RestrictedAccessException: Cannot modify capability
bits on a live or compiled object" for during executing
"root.setCapability(Group.ALLOW_CHILDREN_EXTEND)"
It seems that the root scenegraph of DisplayRendererJ3D is live. Any
suggestion to solve this problem.
Thanks.
Jianting
DisplayRendererJ3D dr =(DisplayRendererJ3D)
display.getDisplayRenderer();
BranchGroup root = dr.getRoot();
System.out.println("is compiled?"+root.isCompiled());
System.out.println("is live?"+root.isLive());
root.setCapability(Group.ALLOW_CHILDREN_EXTEND);
BoundingSphere bounds =new BoundingSphere(new Point3d(0.0,0.0,0.0),
100.0);
Color3f alColor = new Color3f(0.2f, 0.2f, 0.2f);
AmbientLight aLgt = new AmbientLight(alColor);
aLgt.setInfluencingBounds(bounds);
root.addChild(aLgt);