There was a thread on this before.. No you can not serialize as far as i know a scene (at least with j3d 1.1.*; It is very sad but it is so...) I need to check if there is something new under 1.2
any help welcome as it is a common problem: I solved it by doing my own serialization( restricted to my specific case)..not very nice

Olivier Fillon    Minestar Project
[EMAIL PROTECTED]  Mincom Limited
Ph.+61-7-3303-3344               61 Wyandra Street
Fax+61-7-3303-3232               Teneriffe Qld. 4005.
Australia
Company home page: http://www.mincom.com/
Personal home page: http://www.powerup.com.au/~fillon
--- A word from our sponsor ---
This transmission is for the intended addressee only and is confidential
information. If you have received this transmission in error, please delete
it and notify the sender. The contents of this E-mail are the opinion of the
writer only and are not endorsed by Mincom Limited unless expressly stated
otherwise.
 
--
-----Original Message-----
From: Andrei Karii <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Monday, February 07, 2000 11:53 PM
Subject: [JAVA3D] 3D scene serialization problem

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 .
 

Reply via email to