Giles wrote:

>Lee Zhou wrote:
>
>>-Hi,
>>
>>Does any one know if I can get the geometry node component from a VRML
>>SceneGraphObject and hence can
>>change the geometry of that object dynamically?
>>
>If you've loaded the object through the loader interface then you can
>use the getNamedObject method on the scene.  This will work for any
>object DEFed in the scenegraph.
>
>Scene scene = vrmlLoader.load(location);
>scene.getNamedObject("myNode");
>
>if (scene instanceof GeometryArray) {
>    // play with the object here
>}
>
oops.  too much typing from memory...

this should be:

Scene scene = vrmlLoader.load(location);
Hashtable table = scene.getNamedObjects();
SceneGraphObject sgo = (SceneGraphObject) table.get("myNode");

if (sgo instanceof GeometryArray) {

    // play with the object here

}


--
Alan Hudson
President: Yumetech, Inc.                      http://www.yumetech.com/
Web3D Open Source Chair        http://www.web3d.org/TaskGroups/source/

===========================================================================
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".

Reply via email to