Hallo,

I am writing a RTS game in java. The user should be able to create custom 
units. To do this, there are several VRML files showing a Engine, other 
showing a human (shell). 
I am using the Xj3d loader to load this. In the Engine model is a 
TransformGroup named SHELL. Now I want to load the engine, get the named 
group (the TransformGroup) and add the shell Model to this. However the 
loader doesn't give me any named Objects. What I am doing wrong?

The source:

Node shell = null;
Node engine = null;
BranchGroup tmp = new BranchGroup();

String file = "/data/"+ChaosTree.theChaosTree.mod+"/shells/"+theShell.model;
Scene scene = Engine3D.loader.load(getClass().getResource(file));
shell = scene.getSceneGroup();


String file = "/data/test/engines/engine.wrl";
Scene scene = Engine3D.loader.load(getClass().getResource(file));
( (Group)scene.getNamedObjects().get("SHELL")).addChild(shell);
        > I get here the NullPointerException
engine = scene.getSceneGroup();

tmp.addChild(engine);

Thanks,

-- 
Andreas Bauer
[EMAIL PROTECTED]

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