Heya,
Long time reader, first time writer to the lists. I am currently trying
to get to grips with the development of custom nodes, and am currently
working on my second test node. The main purpose of the node is to :
a) Take in an image file of arbritrary resolution as a height map
b) Take in some parameters concerning the resolution of a mesh to be
generated from the image file
c) Generate a mesh from the height map, auto generate per-point normals
by calculating face normals and averaging them.
d) Rendering using the standard geometry rendering mechanism.
As a stand alone core in a stand alone application, it works perfectly,
and can be used by calling :
CAMWaterCorePtr geo = CAMWaterCore::create(); // Named for a
future application of the core
ImagePtr image = Image::create();
image->read("sblack.jpg");
beginEditCP(geo);
geo->setHeightData(image);
geo->setMeshWidth(100);
geo->setMeshHeight(100);
geo->initialiseFromImage(); // This funtion initialises the
mesh from the data.
endEditCP(geo);
I have also created a testClient to show that it distributes correctly,
and after a little clean up concerning missing beginEdits and endEdits,
have it distributing as well.
Here is where my question comes in. I have added a quick test to the
renderEnter function that tests whether the core has been initialised or
not by calling
if (!getInitialised()) {
initialiseFromImage();
}
This means that if for whatever reason, after I edited some details and
decided to invalidate the mesh, and decided to mark it as uninitialised,
it would regenerate the code when the renderAction activates the
renderEnter function.
This has a slightly unexpected effect. When I set up a single server,
and a single client, and run the client through all of the steps above
and I *don't* call geo->initialiseFromImage();, the server receives the
image, mesh resolution and initialisation data, but not the mesh data,
and when it tries to render on the server, it notices that the data
hasn't been initialised, and calls initialiseFromImage() from the
server, so I don't need to distribute very large amounts of geometry. I
have tested and this seems to work, however, only with a single server.
If I attempt to use two different servers (and these are the generic
servers, simply compiled from the OpenSG tutorial), neither of them
register that my core has not been initialised, the client does not
initialise, and so in fact no geometry is ever created. It is as though
the core has not been distributed with the correct value of "initialised".
Is there something fundamentally missing in my understanding about
distribution works, I am missing something? Because with initialisation
happening on the client, it works perfectly, and running it without
distribution works perfectly.
Many thanks for all and any support that you can offer,
Craig Moore
Research Officer
University of Brighton
EPOCH
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users