> Hi Tina,
>
> Looking at your code , I think you get the exception from the removeScope
> call. When you initially do addScope you do it with object "objBg". Are you
> sure you initialiaze that object before your call to createModelClip?

        Hi Nikolaos,

        yes, I do initialize it. Actually I have a Behavior that picks
        objects and highlights them (pickHighlightBehavior). Just before
        I do the model clip I have to first select(pick) and object. Now,
        it seems that it is selecting the right object because it is
        highlighting it and it also returns the right userdata associated
        with the branchgroup (objBG). I then use this objBG for the model
        clip as well. Now again it looks like it is clipping the right
        object because I see that only the selected object on the screen
        changing. But it is only when I am Logging off my client program
        where I am detaching all the branchgroups in the scene that I get
        this below error.

        Tina

>         this is what I am doing :
>
>    BranchGroup bg;
>    createModelClip(BranchGroup objBg)
>    {
>         bg = new BranchGroup();
>         bg.setCapability(BranchGroup.ALLOW_DETACH);
>
>         ModelClip mc = new ModelClip();
>         ----
>         mc.addScope(objBg);
>    }
>
>     removeModelClip()
>     {
>         if(bg != null)
>         {
>                 mc.removeScope(0);
>                 bg.detach();
>         }
>     }
>
>         Thanks
>         Tina
>
> >
> >         Hi All,
> >
> > After I add an object to the scope of the ModelClip instance I get the
> > following exception when detaching the BranchGroup that contains this
> > ModelClip node. Can someone please tell me why it is doing so??
> >
> > exception:
> >
> >      Exception occurred during event dispatching:
> >      java.lang.IndexOutOfBoundsException: Index: 0, Size:0
> >      at java.util.ArrayList.RangeCheck(ArrayList.java:491)
> >      at java.util.ArrayList.remove(ArrayList.java:375)
> >      at javax.media.j3d.GroupRetained.clearLive(GroupRetained.java:1756)
> >      at
> > javax.media.j3d.GroupRetained.checkClearLive(GroupRetained.java:1142)
> >      at
> > javax.media.j3d.GroupRetained.checkClearLive(GroupRetained.java:1104)
> >      at
> javax.media.j3d.GroupRetained.doRemoveChild(GroupRetained.java:301)
> >      at
> > javax.media.j3d.BranchGroupRetained.do_detach(BranchGroupRetained.java:78)
> >      at
> > javax.media.j3d.BranchGroupRetained.detach(BranchGroupRetained.java:65)
> >      at javax.media.j3d.BranchGroup.detach(BranchGroup.java:97)
> >
> >         Thanks for your help
> >         Tina

===========================================================================
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