Hi,
I have a class which inherits from Shape3D and uses a Behavior which implements GeometryUpdater to modify its referenced Geometry during runtime. That works very well when I use one separate instance of this object. When I try to add more of these special Shape3Ds I want that their geometry is modified synchronously so I use Shape3D.cloneTree(false) to get an other Shape3D-object referencing the same geometry data.
Here is my first problem: After the first Shape3D was already added to the scene I get a MultipleParentException when I try to add the second, cloned one. Thats not really clear for me because the cloned copy shouldn't be already part of the scene?
As a workaround I did the following: I used the first instance of the Shape3D as original only to create copies out of it. Using this way of course first I had to add this Shape3Ds Behavior to the universe so that the modification of the geometry could take place. And here following exception occurs when I add the Behavior of the original Shape3D and afterwards add the copy of the Shape3D itself to the scene:
java.lang.NullPointerException at java.lang.System.arraycopy(Native Method) at javax.media.j3d.GeometryArrayRetained.unIndexifyJavaArray(GeometryArrayRetained.java:2976) at javax.media.j3d.GeometryArrayRetained.unIndexify(GeometryArrayRetained.java:2780) at javax.media.j3d.IndexedGeometryArrayRetained.cloneNonIndexedGeometry(IndexedGeometryArrayRetained.java:100) at javax.media.j3d.GeometryArrayRetained.initMirrorGeometry(GeometryArrayRetained.java:10079) at javax.media.j3d.RenderingAttributesStructure.updateObject(RenderingAttributesStructure.java:181) at javax.media.j3d.MasterControl.updateMirrorObjects(MasterControl.java:2734) at javax.media.j3d.MasterControl.runMonitor(MasterControl.java:3432) at javax.media.j3d.MasterControl.doWork(MasterControl.java:2991) at javax.media.j3d.MasterControlThread.run(MasterControlThread.java:28)
So what alternatives do I have when I want to add several identically Shape3Ds whith synchronously modified geometry data when I can't use SharedGroups either?
Michael
-- http://www.3dchat.org - Welcome To The Unreal World http://java3d.virtualworlds.de - The J3D Developers Ressource
=========================================================================== 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".