> From: "Itaru C. Kitazawa" <[EMAIL PROTECTED]>
>
> I have a question related to Java 3D, especially the VRML loader.
> What I want to do is to show a VRML scene graph (or Java 3D scene
> graph) after loading a VRML file.
> Once Sun's VRML loader loads a VRML file and converts it into the SceneGroup,
> the VRML node name is lost.
> I need the VRML-node/VRML-node-name to show the scene graph.
Call VrmlScene.getNamedObjects() to get a Hashtable with of the DEF'd nodes in
the VRML file.
For example, if your VRML file has:
DEF OBJ Transform { ...}
Then you can retieve "OBJ" by calling:
VrmlLoader loader = new VrmlLoader();
VrmlScene scene = loader.load(someUrl);
Hashtable defTable = scene.getNamedObject();
TransformGroup obj = (TransformGroup) defTable.get("OBJ");
Note: The entries in the Hashtable will be stored by the DEF name and will be
Java3D nodes. The specific node type will depend on the Java3D implementation
of the VRML node. Most are pretty direct, i.e. Transform->TransformGroup,
although sometimes a single VRML node will be implemented as a subgraph of
Java3D nodes.
Doug Gehringer
Sun Microsystems
=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 3D Home Page: http://java.sun.com/products/java-media/3D/