NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

Can not add child to root scenegraph of DisplayRendererJ3D

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);


  • 2003 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: