I've got a problem when viewing the same scene from two different viewers :
- Viewer A with Camera A
- Viewer B with Camera B
I load a node with :
Code:
osg::ref_ptr<osg::Node> pNode = osgDB::readNodeFile("...");
Then I do :
Code:
p_viewerA->setCamera(p_cameraA);
p_viewerA->setSceneData(pNode);
p_viewerB->setCamera(p_cameraB);
p_viewerB->setSceneData(pNode);
Everything works fine, but when viewer B is deleted, pNode's textures are no more rendered in viewer A (geometry is still rendered correctly).
Is there anything special to do to share data between two viewer ?
Thank you!
Cheers,
Aurelien
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=44072#44072
_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Well, I would look at it differently (like using slave cameras), but in this case, have you tried dynamically linking the node?
D Glenn
------------------------
David Glenn
---------------
D Glenn 3D Computer Graphics & Media Systems.
www.dglenn.com
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=44083#44083
Can you explain what you mean by "dynamically linking the node" ?
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=44088#44088
Using the osgUtil::Optimizer::TextureVisitor to set all textures to "UnrefImageAfterApply = false"
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=44104#44104
You should use multiple View's within a single CompositeViewer for
doing this rather than multiple viewers.
Robert.
In my application, there is a "main viewer" to edit the scene, and the user can open/close secondary viewer windows.
These secondary viewer windows are not limited in number (sure, there is hardware limits...) and the camera is independant from the other viewers (to see different point of view).
So when user open a new secondary viewer window, I create a new viewer instance, a new camera, and the context is shared with the main window.
When user close a secondary window, I delete the associated viewer to release some resources.
The secondary windows can also be resized, so the viewport is also independant.
Each viewer (main and secondary) are embeded in a Qt widget.
Is there any way to do this with a composite viewer ?
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=44119#44119
Sorry for the slow reply, no trying to catch up on my email backlog...
osgViewer::CompositeViewer is designed for applications that have
multiple Views and your usage model fits this perfectly. The only
thing to be careful of is when you are adding and removing View's from
the CompositeViewer you should do is calling stopThreading() on the
viewer prior to adding or removing views, then call startThreading()
afterwards. If you are running SingleThreaded or
CullDrawThreadPerContext you won't need to worry about stop and
starting threads.
Robert.