Did anyone use j3dfly's stream utility to save scenes?
I used com.sun.j3d.demos.utils.scenegraph.io.SceneGraphStreamWriter,but I encounted an error.
Here is my program:
      FileOutputStream os=new FileOutputStream("xxyy.bg");
      SceneGraphStreamWriter sgsw=new SceneGraphStreamWriter(os);
      ObjectFile of=new ObjectFile();
      Scene scene=of.load("..\\minimart.obj");// it's ok

      BranchGroup bg=scene.getSceneGroup();
      System.out.println("before: "+bg.getBounds());//it's ok

      HashMap p0=new HashMap();
      sgsw.writeBranchGraph(bg,p0);
        FileInputStream is=new FileInputStream("xxyy.bg");
        SceneGraphStreamReader sgsr=new SceneGraphStreamReader(is);
        HashMap p1=new HashMap();
        bg=sgsr.readBranchGraph(p1);
/*Here throws exception : java.lang.RuntimeException: No such class
  even if I set p1=null*/
Could you give me some advice?

 

Reply via email to