Hello Java 3D users !
i've noticed (a) Bug(s) in class ModelClip (same behavior when using
java3d 1.2 running on WIN NT and Linux).
I have several objcts in my scene which can be made visible/invisible by
detaching or adding the appropriate Branchgroup to the scenegraph. This
worked fine.
In the next step I introduced a clipping plane using an object of type
ModelClip (only one of the six possible clipping planes is enabled;
clipping planes parallel the xy, xz, yz planes through the origin - this
is not the default !).
I want to select which of my objects shall be clipped by the plane. This
is done using the ModelClip.addScope( ) and ModelClip.removeScope( )
methods. If the list of scopes is empty the subgraph including the
ModelClip was detached or the clipping plane was disabled (I tried both
variants).
1) However after I added one object to the scope I got the following
exception when detaching the BranchGroup to make the object invisible
(even when I removed it from the scope of the ModelClip class before) I
got the following 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)
(only the relevant stacktrace, without the function calls in my source
code, is printed)
2) I use 3 cameras. One can be rotated around the origin (looking always
to the origin) using a MouseBehavior object. If all objects are clipped
(i.e. all unclipped objects are invisible) then the clipping plane does
rotate with the camera ( it's of course not situated in the subgraph of
the camera, i.e. not influenced of the camera's TransformGroup). The
views of the static cameras remain correct.
Only if both unclipped and clipped objects are visible the plane does
not rotate with the camera (as it should be).
3) Sometimes objects stay clipped when removed from the scope list or
will not be clipped if added to the scope list of the ModelClip object.
I could not find a pattern with that.
PS:
ad 1) and 2): Possible reason could be a synchronisation problem between
2 concurrent threads of Java3d (see c) and ad c) ) ?
I tried the following: I have to checkboxes for each object: one to
add/remove it to the scope list of class ModelClip and one to add/detach
it from the scenegraph. Furthermore a dummy BranchGroup is added to the
scope list of class ModelClip with no children, so that it is not empty
(i.e. global clipping is prevented).
a) Both checkboxs unchecked. Check the Visibility-Checkbox: object
appears. Check the Clipping-Checkbox: nothing happens (should be
clipped).
b) Both checkboxs unchecked. Check Clipping-Checkbox. Check
Visibility-Checkbox: object appears and is clipped.
c) first b) Uncheck Clipping-Checkbox: Nothing happens (should not be
clipped). Uncheck Visibility-Checkbox: object disappears. Check
Visibility-Checkbox: object appears unclipped.
d) Both checkboxes checked. Uncheck Visibility-Checkbox: exception see
1).
e) 2 objects. All checkboxes unchecked. For one object first d). Check
Visibility-Checkbox of second object: object appears but clipped (should
not be clipped).
ad c) I further noticed: if removing from scope list and detaching from
scene graph follows immediately (i. e. immediate function calls without
user interaction through checkboxes) then an exception see 1) occurrs.
I've already added this to the bug database.
But I found out only 2 days ago that this mailing list exists and hope
to get an answer earlier.
Thanks in advance !
===========================================================================
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".