1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
import com.sun.j3d.loaders.vrml97.VrmlLoader;
public class MyLoaderVRML extends JFrame {
public MyLoaderVRML ( ) {
BranchGroup scene = loadScene();
}
public BranchGroup loadScene ( ) {
BranchGroup rootBG = new BranchGroup ( );
VRML97Loader loaderVRML = new VRML97Loader();
Scene theScene = null;
theScene = loaderVRML.load("test.WRL" );
Node forme = theScene.getSceneGroup();
root.addChild(forme);
return root;
}
public static void main(String args[]) {
new MyLoaderVRML ();
}
} |