Hello Martin,

Yes I know, but I won't to use the CompositeViewer. Because I will use this 
feature in the gtk embedded viewer.

CompositeViewer and embedded graphics contexts are two separate things. You can still use a CompositeViewer even if you use an embedded graphics context.

In your case, I assume you're using a single window with multiple views overlaid over the main one? You could create multiple osgViewer::Views, then set the same GraphicsContext (GraphicsWindowEmbedded in your case I guess) on all the views' main cameras. Then set a different CameraManipulator on each view and you're set.

Having now looked at the osgviewerGTK code, I see it has a class OSGGTKDrawingArea that derives from osgViewer::Viewer. That strikes me as unnecessary coupling, but I've only looked at the code quickly, so I don't know the details. You could make this derive from CompositeViewer instead. I don't know what it uses from osgViewer::Viewer - perhaps instead of deriving, it could have a pointer to an osgViewer::ViewerBase instead? Then it would be independent of the viewer type.

Anyways, I can imagine it's probably more work than what you want to do, but CompositeViewer is the tool you need, so using things as designed will be more future-proof. Alternatively calling getInverseMatrix() and setting that matrix on the camera you want might work, or might not. Or just don't use a camera manipulator and write your own event handler that will manipulate the camera's view matrix.

Hope this helps,

J-S
--
______________________________________________________
Jean-Sebastien Guay    jean-sebastien.g...@cm-labs.com
                               http://www.cm-labs.com/
                        http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to