> > We need the scenegraph to be residing on a powerful server, and multiple
> > canvas3Ds to be distributed among clients and added on the fly. 
> > RMI distributed technology should be enough to deal with that.
> > Up till now it was impossible to use it, because Java3D objects are not
> > serializable.
> > 
> > Does this mean it could not be done?
> > Or is there any other mean to tackle this problem in a different way?

It is possible to implement such a scenario if one doesn't send the scene graph
itself over the network, but the necessary changes in form of some objects
(that is the command design pattern).

public class sceneGraphChange {
  public static final int ADD_NODE = 1;
  public static final int REMOVE_NODE = 2;
  // ...

  public int command; // addNode or removeNode or ...
  public int nodeID;  // ID of the node to execute on
  public Object args; // any serializable arguments (containing Vector3d's...)

  public execute() {
    if (command == ADD_NODE) {
      Vector v = (Vector) args;
      String nodeClass = (String) v.elementAt(1);
      Vector names = (Vector) v.elementAt(2);
      Vector values = (Vector) v.elementAt(3);
      // Now create an object of nodeClass and
      // set its attributes with those names and values...
      // all further changes refer to this node using the ID.
    }
  }
} 

Those change objects can be easily transmitted through a socket.
This is about the way I did it for a small project, but I'm not
sure if this could be a general solution.

So I add my vote for some solution to this problem (I don't know
the best way to do it).

Henrik Behrens
=====================================================================
To subscribe/unsubscribe, send mail to [EMAIL PROTECTED]
Java 3D Home Page: http://java.sun.com/products/java-media/3D/

Reply via email to