Hi,
I downloaded the x3d.jar and included a vrml loader in my
application. Then I tried to read some wrl files.
It is quitting every time, the loader is trying to read an image with:
E:/vrml/claddingpanel.wrl
Error: in loading image
Exception: java.lang.NullPointerException
Last token was "}" at line 1786
java.lang.NullPointerException
at
com.sun.j3d.utils.image.TextureLoader.getTexture(TextureLoader.java:4
06)
at
com.sun.j3d.loaders.vrml97.impl.ImageTexture.doChangeUrl(ImageTexture
.java:138)
at
com.sun.j3d.loaders.vrml97.impl.ImageTexture.initImpl(ImageTexture.ja
va:78)
at com.sun.j3d.loaders.vrml97.impl.Parser.Node(Parser.java:527)
...
or sometimes with other errors
What is the problem?
Is there a tutorial how to use the x3d.jar package?
I did manage to see some simple objects like a box.
This is my class which is loading the wrl-file:
public class VrmlViewer {
Layer3D layer3d;
public VrmlViewer(String urlName) {
layer3d = new Layer3D();
VrmlLoader vrml = new VrmlLoader();
try {
Scene sc = vrml.load(urlName);
layer3d.addVrmlScene(sc.getSceneGroup());
}
catch (FileNotFoundException ex) {
System.err.println("File not found: "+ ex.getMessage());
}
}
public Layer3D createLayer3D() {
return layer3d;
}
}
Here I am adding the BranchGroup from the VrmlScene in my
Java3D-Scenegraph:
public void addVrmlScene(BranchGroup bg) {
layertrans.addChild(bg);
}
Thanks for any help, Desiree
o------------------------------------------------------------------------o
| Desiree Hilbring Institut fuer Photogrammetrie und Fernerkundung |
| Universitaet Karlsruhe, Germany |
| |
| email: [EMAIL PROTECTED] |
| # 0721 6083676 |
o------------------------------------------------------------------------o
===========================================================================
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".