i just tried the prototype for saving scenegraphs in the scenegraph.io
package but i must be doing something wrong coz its producing this error

Exception in thread "main" java.lang.OutOfMemoryError
        <<no stack trace available>>

here's what im doing:

            BranchGroup
                |
                |
            TransformGroup    ColoringAttribute
                \                /
                  \            /
                    \        /
                      \    /
                        Box

public void save(SimpleUniverse su, BranchGroup bg) {
  try{
    SceneGraphFileWriter writer = new SceneGraphFileWriter(new
                      File("library.j3d"),su,true,"sample",null);
    writer.writeBranchGraph(bg);
    writer.close();
  }catch (Exception exc){}
}

public void load() {
  SimpleUniverse su = null;
  try {
    SceneGraphFileReader reader = new SceneGraphFileReader(new File("library.j3d"));
    su = (SimpleUniverse)reader.readUniverse(true);
    reader.close();
  }catch (Exception exc) {System.out.println(exc); }
  Frame f = new Frame();
  f.setLayout(new BorderLayout());
  f.setSize(300,300);
  f.show();
  Canvas3D canvas3D = su.getCanvas();
  f.add("Center", canvas3D);
  validate();
}

error is produced in creating the SceneGraphFileReader.
thanks in advance.

- ian


__________________________________
www.edsamail.com

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