Subject: | |
From: | |
Reply To: | |
Date: | Sun, 6 Sep 2009 22:26:42 +0200 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Okay, first things first. Do another CVS update as my commit was
actually in two stages, and your description has the smell of you only
having the first stage.
The exception you're seeing here is due to reuse of the underlying
Shape3D inside a Sphere or other kind of object, where (for example)
the Sphere is sharing geometry with another Sphere. This generally
shouldn't be happening -- we force a clone of the Java3D node, right
down to making copies of the geometry so they're not shared. It's
very memory expensive but allows us to avoid exactly the exceptions
you're seeing below. Specifically, line 157 of PrimitivePortrayal3D
should say:
TransformGroup g = (TransformGroup) (group.cloneTree(true));
That 'true' should be doing the trick. It's possible that it might
not be saying that (which means you don't have a full update). Double-
check it for me.
Sean
On Sep 6, 2009, at 9:59 PM, Joerg Hoehne wrote:
> Hi Sean,
> for me the code for 3d display is not working anymore. Before the
> update I was able to display a
> scene but was not able to change colors.
> After the update I get the exception:
>
> Exception in thread "AWT-EventQueue-0"
> javax.media.j3d.RestrictedAccessException: Cannot
> modify capability bits on a live or compiled object
> at
> javax.media.j3d.SceneGraphObject.setCapability(SceneGraphObject.java:
> 101)
> at
> sim
> .portrayal3d
> .SimplePortrayal3D.setPickableFlags(SimplePortrayal3D.java:235)
> at
> sim
> .portrayal3d
> .SimplePortrayal3D.setPickableFlags(SimplePortrayal3D.java:227)
> at
> sim
> .portrayal3d
> .simple.PrimitivePortrayal3D.getModel(PrimitivePortrayal3D.java:167)
> at
> sim
> .portrayal3d
> .SparseFieldPortrayal3D
> .wrapModelForNewObject(SparseFieldPortrayal3D.java:77)
> at
> sim
> .portrayal3d
> .SparseFieldPortrayal3D.updateModel(SparseFieldPortrayal3D.java:157)
> at sim.portrayal3d.FieldPortrayal3D.getModel(FieldPortrayal3D.java:
> 182)
> at sim.display3d.Display3D.updateSceneGraph(Display3D.java:1209)
> at sim.display3d.Display3D$12.run(Display3D.java:1152)
> at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
> at java.awt.EventQueue.dispatchEvent(EventQueue.java:633)
> at
> java
> .awt
> .EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:
> 296)
> at
> java
> .awt
> .EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
> at
> java
> .awt
> .EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:
> 201)
> at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:
> 196)
> at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:
> 188)
> at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
>
>
> After having a look inside the source code it looks like there some
> slight differences between the
> various XXXPortrayal3D classes that might not be intended, like the
> missing call of
> setShape3DFlags(Shape3D shape) where I guess (really a wild guess)
> the problem might be
> located.
>
> For a quick fix (it's late in my time zone) I rely only on
> CubePortrayal3D and the code does not
> throw any exception at the moment. Using the SpherePortrayal3D class
> does crash the
> application. I don't have the time to explore on this subject today
> and tomorrow so you or Gabriel
> may have a quick fix available.
>
> Regards,
> Jörg
|
|
|