[osg-users] How to setup multi channel

Dan Liu 139250065 at qq.com
Wed Jan 13 09:01:00 PST 2016

Dear Robert:
     Thank you very much! 
     I have studied osgwindow. If I have 20 computer, each computer has 1 monitor. And my screen wall is 4 rows, 5 columns. Should I setup osg::GraphicsContext::Traits if I run viewer in full screen mode? For example, a screen's row_no=2 and column_no=2(index begin from 0), it should display x range from 50% to 75% and y range from 40% to 60%, and scale aspect ratio to 5/4=1.2. 
     I don't know how to change matrix in below line:
 viewer.addSlave(camera.get(), osg::Matrixd::translate(1.0,0.0,0.0), osg::Matrixd()); 
     And scale function does not work: viewer.getCamera()->getProjectionMatrix() *= osg::Matrix::scale(1.2, 1.0, 1.0) has no effect, x scale is not changed. But viewer.getCamera()->getProjectionMatrix() *= osg::Matrix::scale(1.2, 1.2, 1.2) can works, the earth becomes bigger in both x, y, z dimension.
 With best regards

  ------------------ Original ------------------
  From:  "Robert Osfield";<robert.osfield at gmail.com>;
 Date:  Wed, Jan 13, 2016 05:29 PM
 To:  "OpenSceneGraph Users"<osg-users at lists.openscenegraph.org>; 
 Subject:  Re: [osg-users] How to setup multi channel


Hi Daniel,

The OSG is designed for handling multi-channel system and provides the
support via the osgVIewer support for master + slave Camera.

The osgwindow example is probably the most straight forward
implementation to look at - this creates two windows and assign these
to two slave osg::Camera, which are both assigned to a single
osgViewer::Viewer (subclass from osgViewer::View which subclasses from
osg::View) which provides the master Camera.

The overall view is controlled by the master Camera attached to the
View(er) which provides the main view and projection matrices.  The
slave Camera's that are assigned to the View(er) have offset matrices
that multiplied by the master's view and projection matrices to give
the final view and projection matrices that the Slave camera will use.

Other examples of the slave camera in action can be seen in the
osgViewer::ViewConfig implementations found in the
src/osgViewer/config directory.  The neatest way to implement what you
need would be to implement your own custom osgViewer::ViewConfig that
sets up the appropriate Slave Camera you need, then when you want to
set up your viewer for this display system you simply pass in this
ViewConfig and have it configure the View(er) as required.


On 13 January 2016 at 03:50, Dan Liu <139250065 at qq.com> wrote:
> Dear all:
>     Hello! I'm using OSG to develop an application which run as screen
> wall(M rows, N columns). I studied the osgcluster example. But still don't
> know how to split master screen into MXN sub screens, and scale the screen
> according to the screen wall's real resolution.
> With best regards
> Daniel
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
osg-users mailing list
osg-users at lists.openscenegraph.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20160114/0dde6189/attachment.htm>

More information about the osg-users mailing list