Have you look at this?
http://www.j3d.org/faq/vrml.html



----- Original Message -----
From: "Josh Richmond" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 07, 2000 12:18 AM
Subject: [JAVA3D] howto get names of object from inline VRML


Hi everyone,

I've searched the archive and API, but can't seem to figure this out: I want
to get references to all named Shape nodes in a VRML file which includes
Shapes in any inlined files. My code to do this is below, and I've attached
two sample .wrl files (jlink2.wrl) is the parent file.

It seems like Scene.getNamedObjects() does not recognise named objects in
inlined files, but does recognise the name of the Inline node (as a Group).

If anyone could tell me how to get around this I would really appreciate it.
Thanks!

josh

public void showNodeNames(Scene theScene)
{
    Enumeration list = theScene.getNamedObjects().keys();

    // Go through the enumeration list
    while (list.hasMoreElements()) {

        String shapeName = (String) list.nextElement();
        Node node = (Node) theScene.getNamedObjects().get(shapeName);

        System.err.println(shapeName + " is a " + node.getClass());
    }

    // extra test for the included files... look for "joint2" which is in
jlink3.wrl
    if (theScene.getNamedObjects().get("joint2") == null)
        System.out.println("joint2 not found!");
    else
        System.out.println("joint 2 found");
}

When I try this with jlink2.wrl, joint2 is not found. With jlink3.wrl, it is
found.

----------------------------------------------------
Joshua L. Richmond, BASc, MSc.
Systems Engineering (R&D)

MD Robotics
9445 Airport Rd, Brampton, ON, Canada
(905) 790-2800 x4332
-----------------------------------------------------




_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.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".

Reply via email to