Hi All ! ,
What You think about how is possible to save dynamically content of 3D scenes as BranchGroup with all its children with their current values of them fields into the file and then to read it from file and to load into scene on-fly by add and replace BranchGraph methods of Locale object ? When i try write BranchGroup or ColorCube to ObjectOutputStream as : BranchGroup scene = new BranchGroup(); scene.addChild(new ColorCube(0.1)); try{ FileOutputStream fs = new FileOutputStream("scene.serial"); ObjectOutputStream os = new ObjectOutputStream(fs); os.writeObject(scene); // or os.writeObject(new ColorCube(0.1)); os.flush(); }catch(Exception e){ System.out.println ("from writing scene: \n"+e.toString()); } then see at runtime : from writing scene: java.io.NotSerializableException: javax.media.j3d.BranchGroup (or ColorCube) So,I look for any ideas of how to save and read scene objects
into and from file. May be exists some classes for this ?
Or some native code ? How i think ,it may be applied in games and 3d-editors
or somewhere else. Thank for attention , Andrei Karii
.
|
- Re: [JAVA3D] 3D scene serialization problem Andrei Karii
- Re: [JAVA3D] 3D scene serialization problem Olivier fillon