Hello I have some problem with the scene graph updating
I made a client/server application the client build a scene graph root->camera->box and I move the camera at the Update procedure and then send on a socket to the server the whole graph but in the server i can't refresh the scene…
some code:
my graph…
protected void initGame() {
display.setTitle("Synconize Client");
scene = new Node("Scene:Graph");
// We will create a box with sides of length 10 and will be centered
// about the origin.
Vector3f center = new Vector3f(0f, 0f, 0f);
b = new Box("OBJ:Box", center, 3f, 3f, 3f);
b.setModelBound(new BoundingBox());
b.updateModelBound();
int axisSamples = 5;
int radialSamples = 5;
float radius = 2;
float height = 5;
Cone c = new Cone("OBJ:Cone", axisSamples, radialSamples, radius,
height);
cam = new CameraNode("Nod:Cam", camera);
cam.attachChild(b);
cam.attachChild©;
scene.attachChild(cam);
// scene.updateGeometricState(0.0f, true);
}
client update here I move the camera…
protected void update(float interpolation) {
time.update();
interpolation = time.getTimePerFrame();
if (KeyBindingManager.getKeyBindingManager().isValidCommand("for")) {
// camera = display.getRenderer().getCamera();
Camera camera = cam.getCamera();
Vector3f location = new Vector3f(0.0f, 20.0f, (float) (camera
.getLocation().getZ() + 0.1f));
camera.setLocation(location);
Vector3f up = new Vector3f(0f, 1f, 0f);
Vector3f center = new Vector3f(0f, 0f, 0f);
camera.lookAt(center, up);
camera.update();
// display.getRenderer().setCamera(camera);
}
…
and here I tried to refresh the camera in the server
protected void update(float interpolation) {
…
camera = cam.getCamera();
camera = display.getRenderer().getCamera();
camera = cam.getCamera();
camera.update();
display.getRenderer().setCamera(camera);
…
where cam is a camera nod from the graph
The graph in he server it is built good I checked at debug mode…