Urgent : Loading WRL and X3D with embedded textures
843799Mar 20 2007 — edited Mar 28 2007Hey, I am creating a program to load buildings in .wrl format with texture references into a Java applet. I am experiencing one major problem in that I cannot even load a building.
I am using the xj3d loaders to do so, and have tried converting the WRL files to embed textures into a single file in both X3D and WRL format. When loading these into an X3D viewer, such as Octaga, I have no problem seeing them. When I try to load in Java, I get null pointer exceptions.
Here is the code I am using to load. Am I missing something?
Loader loader = new X3DLoader();
Canv canvas3D = new Canv(config);
add("Center", canvas3D);
Scene x3dscene = null;
x3dscene = loader.load("102_SPARKS.x3d");
BranchGroup objRoot = new BranchGroup();
TransformGroup objTransform = new TransformGroup();
objTransform.setCapability (TransformGroup.ALLOW_TRANSFORM_WRITE);
objTransform.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
objRoot.addChild(objTransform);
objTransform.addChild(x3dscene.getSceneGroup());
I have also tried loading without the embedded textures. I get no errors, but in the System output screen I get :
Rescaling file:///C/window_brown_wood_color.jpg to: 512 x 256
Rescaling file:///C:/aj_sign.jpg to: 1024 x 128
... etc.
But nothing shows up in the applet.
PLEASE HELP!