Bob,
Java3D 1.3 includes com.sun.utils.scenegraph.io package which performs IO
operations on a scene graph. It includes an interface that you can implement to
have you own nodes handled correctly.
If your not using Java3D 1.3, then J3dFly (available from the java3d web site)
includes an earlier release of the package in
com.sun.j3d.demos.utils.scenegraph.io.
Rgds
Paul
>Date: Fri, 12 Jul 2002 15:41:50 -0400
>From: RWGRAY <[EMAIL PROTECTED]>
>Subject: [JAVA3D] Serializable?
>To: [EMAIL PROTECTED]
>MIME-version: 1.0
>X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
>Content-transfer-encoding: 7bit
>Importance: Normal
>X-Priority: 3 (Normal)
>X-MSMail-priority: Normal
>Delivered-to: [EMAIL PROTECTED]
>
>I am now going to write a Java 3d program in which I can save a scene to a
>file and read it back again latter.
>
>So, I define my root sceneObject class to implement Serializable.
>
>I extend sceneObject to define a class (objectPositionable) of all objects
>in the scene that is positionable (can move, spin). This class has a method
>and variables to build and return a BranchGroup having the TransformGroups
>attached to do this motion.
>
>I then extend this objectPositionable class to include objects that are
>scalable, that can change size (objectSizable). This has a method and
>variables to return a BG with a scale transform group attached.
>
>And I extend this objectSizable class to define, for example, mySphere,
>myCube, or other geometry objects to be displayed.
>
>Now, the BranchGroups, etc. at each class level are defined with transient.
>
>If I write out the mySphere class how do I handle reading it back in?
>
>Is there a way to call all the constructor methods of all the parent classes
>for the mySphere class? Does this happen automatically? (I don't think
>reading a serialized class back into Java calls any of the class'
>constructor methods does it?)
>
>Is there another structure that would be better to use for saving and
>retrieving Java 3D scenes?
>
>Should I have a method *in each* of these classes to rebuild the
>BranchGroups and other transient variables? Something like
>
>public void rebuild()
>{
> super.rebuild(); // To allocate parent class transient variables.
>
> // allocate transient variables (BranchGroup, etc) for this class level.
>
> // attach this BranchGroup to the parent BranchGroup
>}
>
>I would be interested in learning how others are doing this setup/allocation
>of transient variables after reading a class back in.
>
>Cheers,
>Bob Gray
>
>===========================================================================
>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".
----------------------------------------------------------
Paul Byrne Email : [EMAIL PROTECTED]
Sun Microsystems Phone : (650) 786 9926
Visualization Software Group Fax : (650) 786 5852
----------------------------------------------------------
===========================================================================
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".