Java3d experts.
I got a crash while trying to "externalize" my Java3d
scene using j3dfly libraries. The stack roughly looks
like that:
ava.lang.reflect.InvocationTargetException:
java.util.EmptyStackException
at java.util.Stack.peek(Stack.java:82)
at
com.sun.j3d.demos.utils.scenegraph.io.retained.SymbolTable.createNodeComponentSymbol(SymbolTable.java:347)
at
com.sun.j3d.demos.utils.scenegraph.io.retained.SymbolTable.addReference(SymbolTable.java:447)
at
appearance.TextureCollection.createSceneGraphObjectReferences(TextureCollection.java:109)
at
model.Model.createSceneGraphObjectReference(Model.java:428)
Here what I did to get to this point.
I have an object Model:
public class Model extends BranchGroup implements
SceneGraphIO
{
protected TextureCollection textures;
..............
public void createSceneGraphObjectReferences(
SceneGraphObjectReferenceControl ref )
{
..............
textures.createSceneGraphObjectReferences(ref);
}
public void restoreSceneGraphObjectReferences(
SceneGraphObjectReferenceControl ref )
{
.....................
textures.createSceneGraphObjectReferences(ref);
}
}
public class TextureCollection
{
Hashtable tuxtures;
public void createSceneGraphObjectReferences(
SceneGraphObjectReferenceControl ref )
{
}
public void restoreSceneGraphObjectReferences(
SceneGraphObjectReferenceControl ref )
{
}
}
As one can see, Model contains a collection of
references to Textures.
This let me save some
memory/management in dealing with textures.
Hierarhically it look like this diagram
Model(BranchGroup)
|
|
-- TransferGroup
|
|
--- BranchGroup
|
|
------ TransferGroup
|
|
--Shape3D
|
|
-- Appearance
|
|
---Texture
So everything looks O'key from my point of view of a
j3dfly user. However, my Model indirectly references
textures which stays far below in the hierarchichal
tree. I have a hypothesis that something is funny with
the way j3dfly handles javax.media.j3d.NodeComponent
object since all my crashes so far were
related to these objects (Textures, Appearances,
Geometry) whereas javax.media.j3d.Node objects are
handled properly. I assume j3dfly does
not hash them at the point where
createSceneGraphObjectReferences is called for top
BranchGroup(Model).
Let me know of your experience in resolving references
to NodeComponent objects.
Thank you for your help
Boris.
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
===========================================================================
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".