Hi, I'm using java3d 1.3 on linux. I try to save my scene graph with the SceneGraphIO utility. Both save and restore works fine except for the following:
The user of my app may let the ViewPlatform orbit in a circle. This may be implemented in a number of ways; I have chosen to extend the PositionInterpolator (replacing the computeTransform method) and implementing the SceneGraphIO interface. I first tried to extend the TransformInterpolator, but this fails, apparently because the SceneGraphIO writer tries to instantiate the abstract class TransformInterpolatorState. So I chose to extend a non-abstract class. When doing this I first encounter a problem when saving the graph, the SceneGraphFileWriter complains that a certain TransformGroup is referenced, but not part of the scene graph. This turns out to be the target group of the Interpolator, i.e. just above the ViewPlatform. I suspect it's saved as part of a multi transform group or something, so the SceneGraphIO stuff doesn't quite recognize it when saving the Interpolator. I've solved this by, when saving, letting the target of the Interpolator be a separate dummy TransformGroup, and restoring the right target when reading in the graph. The scene graph now saves all fine. But it doesn't restore. I get a stack dump from readUniverse: > java.lang.ClassCastException > at > com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d.TransformInterpolatorState.readObject(TransformInterpolatorState.java:73) > at > com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d.PositionInterpolatorState.readObject(PositionInterpolatorState.java:67) > at > com.sun.j3d.utils.scenegraph.io.retained.Controller.readObject(Controller.java:340) > at > com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d.GroupState.readObject(GroupState.java:86) > at > com.sun.j3d.utils.scenegraph.io.retained.Controller.readObject(Controller.java:340) > at > com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d.GroupState.readObject(GroupState.java:86) > at > com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d.TransformGroupState.readObject(TransformGroupState.java:70) > at > com.sun.j3d.utils.scenegraph.io.retained.Controller.readObject(Controller.java:340) > at > com.sun.j3d.utils.scenegraph.io.state.javax.media.j3d.GroupState.readObject(GroupState.java:86) > at > com.sun.j3d.utils.scenegraph.io.retained.Controller.readObject(Controller.java:340) > at > com.sun.j3d.utils.scenegraph.io.retained.RandomAccessFileControl.readNextBranchGraph(RandomAccessFileControl.java:319) > at > com.sun.j3d.utils.scenegraph.io.retained.RandomAccessFileControl.readSingleBranchGraph(RandomAccessFileControl.java:306) > at > com.sun.j3d.utils.scenegraph.io.retained.RandomAccessFileControl.readBranchGraph(RandomAccessFileControl.java:242) > at > com.sun.j3d.utils.scenegraph.io.retained.RandomAccessFileControl.readBranchGraphs(RandomAccessFileControl.java:186) > at > com.sun.j3d.utils.scenegraph.io.retained.Controller.readUniverse(Controller.java:470) > at > com.sun.j3d.utils.scenegraph.io.retained.RandomAccessFileControl.readUniverse(RandomAccessFileControl.java:169) > at > com.sun.j3d.utils.scenegraph.io.SceneGraphFileReader.readUniverse(SceneGraphFileReader.java:113) > at no.uio.nesys.m3d.Viewer.restoreUniverse(Viewer.java:869) Now, unfortunately, for some reason I don't have TransformInterpolatorState.java (although I do have PositionInterpolatorState.java), so I can't debug this stuff. Does anybody have a suggestion how to work around this problem? Does anybody know where the complete source for the SceneGraphIO stuff can be downloaded? I don't seem to receive a stable feed of this list, so please CC me. -- Simen Gaure, Scientific Computing Group, USIT, University of Oslo =========================================================================== 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".
