Vinay Shah wrote:
There is a scene generation thread which builds up the scene graph and updates
position of various nodes.
Each camera thread has it's own viewer which renders (using the viewer.frame() ) part of the same scene graph. The only different in the
scene graphs between the camera threads is that each has it's own camera node. The camera position, view direction, and zoom are altered in the camera thread.
I believe I am in violation of the general rule, but is there a way around this using mutex protection?
Not really. You could theoretically do it by multi-buffering your
scene, but this is probably not the best approach.
If I might suggest a different, more OSG-friendly approach, you could
alter your app to use a CompositeViewer with four Views (each view
containing one of your cameras). Your main thread would then handle
updating the scene before it calls viewer.frame(). If you've got each
camera drawing to a different context, you'll still have the same thread
architecture if you use the DrawThreadPerContext threading model, but
they will automagically be managed properly.
--"J"
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org