Hi Kelvin,

> Hi Sameer,
>
> >
> >I have the following scenegraph:
> >
> >BranchGroup
> >|_____TransformGroup
> >      |_____ BranchGroup b
> >             |____ BranchGroup b1
> >                   |_______ Morph m1
> >                   |_______ Morph m2
> >                   |_______ Behavior object with trigger as
> mouse click
> >             |____ BranchGroup b2
> >             |____ BranchGroup b3
> >             |____ BranchGroup b4
> >
> >b1, b2, b3 and b4 are identical with different geometries.
> >m1 and m2 are different morph objects.
> >
> >At some stage, I want to replace the geometries of b1 with some other
> >geometry.
> >But, due to some bug in Java3D, I have to detach this
> branchgroup, create a
> >new
> >one with the other geometry and attach it to the branchgroup b.
>
> Can you please give us a test program to show this bug ?

The bug that I have referred to here is the same for which I had sent test
codes
in my earlier mail dated 8th Nov 2000 with subject "Java 3d 1.2 Bug -
GeometryArray byReference." to [EMAIL PROTECTED]

You had confirmed with the bug numbers as:
----------------------

  Bug 4387382 -
  ArrayIndexOutOfBoundsException when GeometryStripArray unIndexify

is submitted for the first two problems for investigation
which both throws Exception in the same place:


  For the last problem, this bug
   4340598 - Morph did not work after setGeometryArrays() in behavior
is fixed in v1.2.1 beta2 (but not v1.2.1 beta1)

----------------------

Sorry about the confusion. What I actually meant by that statement is that
this approach is a workaround because of those bugs.

>
>
> >
> >Replacing (attaching and detaching) of the geometry b1 works
> fine, but after
> >that,
> >when I try to pick the object using the mouse, it gives me
> the following
> >exception:
> >
> >Exception occurred during Behavior execution:
> >java.lang.IllegalStateException: Picking can only work if
> BranchGroup is
> >alive
> >        at javax.media.j3d.BranchGroup.pickAll(BranchGroup.java:115)
> >        at
> >com.sun.j3d.utils.picking.PickTool.pickGeomAllSortedIntersect
> (PickTool.java:
> >793)
> >        at
> >com.sun.j3d.utils.picking.PickTool.pickGeomClosestIntersect(P
> ickTool.java:84
> >7)
> >        at
> com.sun.j3d.utils.picking.PickTool.pickClosest(PickTool.java:515)
> >        at
> >com.liqwidkrystal.vBook.behaviors.MorphBehavior.processStimul
> us(MorphBehavio
> >r.java:258)
> >        at
> javax.media.j3d.BehaviorScheduler.doWork(BehaviorScheduler.java:167)
> >        at javax.media.j3d.J3dThread.run(J3dThread.java:256)
> >
> >Is it not that when I add a BranchGroup to an already
> compiled branch group
> >(b in this case),
> >the added branch group becomes live?
>
>
> This mean the BranchGroup did not successfully add to the scene graph.
> Which function do you use to add/replace the old branchgroup ?
> You should get some kind of Exception when adding a branchgraph
> but not success. Please make sure you don't catch the Exception
> and ignore the message.
>

I am using the method, branchgroup.setChild (Node, index) to replace the
branchgroup b1.
It successfully adds because I am able to view the geometries corresponding
to the new branchgroup added. Also, no exception is thrown at that instance.
But it is only when I click on the object that the exception is thrown.


- Sameer


>
> >
> >Also, the behavior is expected till the mouse is clicked on
> the geometry of
> >the
> >newly added branch group.
> >
> >Am I doing something wrong? Or something more has to be done
> to make the
> >newly
> >added branch group live?
> >
> >
> Thanks.
>
> - Kelvin
> ----------------
> Java 3D Team
> Sun Microsystems Inc.

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