> From: Tachio Terauchi <[EMAIL PROTECTED]>
> 
> What's the fastest way to extract the Shape3D nodes from a scene loaded by
> the VrmlLoader?  Do I need to recursively search the tree nodes one by
> one?  Thanx in advance. 

Use a DEF to name the Shape nodes in the VRML file.  Then use 
VrmlScene.getNamedObjects() to get a reference to the Java3D implementation for 
the Shape.  This will be a Link to a SharedGroup containing the Shape3D.  You 
can either use the Link or follow the link to the SharedGroup and detach the 
Shape3D from the SharedGroup (assuming the scene is not live).

You get a Link to the node instead of a reference to the Shape3D because the 
VRML loader is returning a new instance of the implementation of the VRML node 
for you to use.  Since the VRML Java3D tree is already has a reference to the 
Shape3D, we need to use a Link/SharedGroup to allow multiple uses of the 
Shape3D.

Doug Gehringer
Sun Microsystems


=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 3D Home Page: http://java.sun.com/products/java-media/3D/

Reply via email to