I have an application in which a scene graph is built from many many
imported VRML models. The models are loaded and the returned
BranchGroups are wrapped by some application-specific code -- basically
another BranchGroup and then added to the scene graph. The world itself
is built at runtime via the execution of a script that determines which
VRML models to load and directs the building of the application-specific
wrappers. Anyway, once the script got too big I started getting out of
memory errors and decided I had to optimize. Many of the imported models
are the same (many foo.wrls for instance) so I figured I'd use a
SharedGroup node and instead of having the application-specific wrapper
BranchGroups add the loader-returned BGs directly, they'd add a link to
the SharedBranch. Well it looks like it works in the beginning, and I see
the first few models, but when it has to load models that initially are
not visible (their wrappers are in a big switch that is controlled by a
Distance LOD that puts them far away from the Viewpoint) I get a
NullPointerException in the Traverser. Here's the exception:
java.lang.NullPointerException:
at javax.media.j3d.Traverser.traverse(Traverser.java:1779)
at javax.media.j3d.Traverser.traverse(Traverser.java:978)
at javax.media.j3d.Traverser.traverse(Traverser.java:1713)
at javax.media.j3d.Traverser.traverse(Traverser.java:721)
at javax.media.j3d.Traverser.traverse(Traverser.java:807)
at javax.media.j3d.Traverser.traverse(Traverser.java:978)
at javax.media.j3d.Traverser.traverse(Traverser.java:1713)
at javax.media.j3d.Traverser.traverse(Traverser.java:807)
at javax.media.j3d.Traverser.traverse(Traverser.java:721)
at javax.media.j3d.Traverser.traverse(Traverser.java:904)
at javax.media.j3d.Traverser.traverse(Traverser.java:721)
at javax.media.j3d.Traverser.traverse(Traverser.java:807)
at javax.media.j3d.Traverser.traverse(Traverser.java:721)
at javax.media.j3d.Traverser.traverse(Traverser.java:807)
at javax.media.j3d.Traverser.run(Traverser.java:2069)
Needless to say, I'm between a rock and a hard place here. If I don't
use the shared groups I run out of memory (In my particular app it really
makes sense to load the entire scene all in the beginning instead of
inrementally -- but there are no textures), but when I do, I get this
error.
Heeeelp.
thanks,
-Scott
Scott Gross
Columbia University CC '98
549 Manhattan Avenue #2
New York, NY 10025
_________________________________________________________________________
(212) 939-7100
[EMAIL PROTECTED]
[EMAIL PROTECTED]
www.cs.columbia.edu/~sbg23
=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 3D Home Page: http://java.sun.com/products/java-media/3D/