you have to set allow detach bit for the BranchGroup you want to detach. so you
have to set detach for the "scene"
from the java3D document:
>BranchGroup Field Summary
>static int ALLOW_DETACH
>For BranchGroup nodes, specifies that this BranchGroup allows detaching from
its parent.
so you need:
scene.setCapability(BranchGroup.ALLOW_DETACH );
Utku Er.
___________________________________________________________
How do you shoot the devil in the back? What if you miss?
Roger Verbal Kint
>-----Original Message-----
>From: [EMAIL PROTECTED]
>[mailto:[EMAIL PROTECTED]]On Behalf Of Christopher
>Currie
>Sent: Thursday, January 28, 1999 2:07 AM
>To: [EMAIL PROTECTED]
>Subject: [java3d] (no subject)
>
>
>Dear j3D experts,
>
>Ok . . . I create a TransformGroup object, and I want to remove any
>children that it might acquire:
>
> sceneTransform = new TransformGroup( );
> sceneTransform.setCapability(
> Group.ALLOW_CHILDREN_WRITE ); // want to remove children
>
>ok, let's add a BranchGroup:
>
> BranchGroup scene = new BranchGroup( );
> scene.addChild(new ColorCube(0.4));
> sceneTransform.addChild( scene ); // "scene is what I'd like to
>remove
>
>
>ok, later, I want to remove this BranchGroup object:
>
> sceneTransform.removeChild(0);
>
>Mysteries and enigmas arise -- I get this from the java compiler:
>
> javax.media.j3d.CapabilityNotSetException: Group: no capability to
>
>detach BranchGroup
> at javax.media.j3d.Group.removeChild(Group.java:189)
>
>If the j3D API specifications suggests another sequence of operations to
>
>remove a BranchGroup, I can't find it. Help! And thanks.
>
> - Cheers,
> Christopher
>
>--
> Christopher Currie | EMAIL: [EMAIL PROTECTED]
> http://kahuna.psych.uiuc.edu/~ccurrie/homePage.html
> |
> Laboratory for Computational Astrophysics (LCA)
> at the NCSA and Beckman Institute at the University of Illinois
> INTERNET INTERFACE TO NUMERICALY SIMULATED GALAXY CLUSTERS:
> http://sca.ncsa.uiuc.edu/
> and
> Imaging Systems Laboratory INTERACTIVE 3-D FOREST ENVIRONMENT:
> http://imlab9.landarch.uiuc.edu/smartforest/
>----
>
>
>=====================================================================
>To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
>Java 3D Home Page: http://java.sun.com/products/java-media/3D/
>
=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 3D Home Page: http://java.sun.com/products/java-media/3D/