Hi,

I am trying to duplicate a Group attached to a Switch node in order to
put it in its own frame. So I detach my scene (removeBranchGraph()),
get a reference to the current child of the Switch node and call its
cloneTree()-method. I tried witch J3d 1.1.1 on Linux and SGI and
always got the following error message:

Exception occurred during event dispatching:
java.lang.IndexOutOfBoundsException: Index: -1, Size: 182
        at java.util.ArrayList.RangeCheck(ArrayList.java:492)
        at java.util.ArrayList.remove(ArrayList.java:374)
        at 
javax.media.j3d.NodeComponentRetained.removeUser(NodeComponentRetained.java:60)
        at javax.media.j3d.Shape3DRetained.setGeometry(Shape3DRetained.java:125)

        at javax.media.j3d.Shape3D.setGeometry(Shape3D.java:151)
        at javax.media.j3d.Shape3D.cloneTree(Shape3D.java:425)
        at javax.media.j3d.Group.cloneTree(Group.java:361)
        at javax.media.j3d.Group.cloneTree(Group.java:361)
        at javax.media.j3d.Group.cloneTree(Group.java:361)
        at javax.media.j3d.Group.cloneTree(Group.java:361)
        at javax.media.j3d.Node.cloneTree(Node.java:378)
        at javax.media.j3d.Node.cloneTree(Node.java:305)
(following lines truncated)

I have also tried witch J3D1.2b1 on Win95. There it worked once, but
on a second try I also got an IndexOutOfBoundsException with an index
of -1, so I guess it could be a bug in J3D.
The group I want to clone is a simple subclass of Group with one int
as a member variable added. Because I do not need this int in the
cloned tree I have written no special routine to duplicate
it. Attached to the group are only TransformGroups which contain a
single sphere or cylinder from the com.sun.j3d.util classes.

I hope anyone can help,

Ingo Brunberg

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to