Hi Petr,<br><br>By default the slave camera's have their project and view matrices updated relative to the master camera on each frame, this scheme allows the OSG to do handle multiple screen setups seemlessly.  If you want a slave camera to be entirely decoupled from the master then set the ReferenceFrame of the camera to ABSOLTE_RF rather than the default of RELATIVE_RF.  <br>
<br>If you have an entirely decoupled view on the scene(s) you might also be better served by using two views in a CompositeViewer.<br><br>Robert,<br><br><br><div class="gmail_quote">On Tue, Mar 31, 2009 at 9:20 AM, petr srom <span dir="ltr"><<a href="mailto:srom@jkzsim.cz">srom@jkzsim.cz</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br>
<br>
please, can you tell me why the camera_slave have got the same position (eye) as the camera_main? What I'am doing wrong? I cannot set different position and frustum than is in camera_main? The camera slave take (inherit) the setting of camera main? Here is the code:<br>

<br>
void MultiCameras::multipleCameras(osgViewer::Viewer *viewer)<br>
{<br>
        camera_main_create(viewer);<br>
        camera_slave_create(viewer);<br>
}<br>
<br>
void MultiCameras::camera_main_create(osgViewer::Viewer *viewer)<br>
{<br>
        osg::ref_ptr<osg::Camera> camera = new osg::Camera;<br>
        camera->setGraphicsContext(gc);<br>
        camera->setViewport(0, 0, 650, 500);<br>
        GLenum buffer = traits->doubleBuffer ? GL_BACK : GL_FRONT;<br>
        camera->setDrawBuffer(buffer);<br>
        camera->setReadBuffer(buffer);<br>
        camera->setClearColor(mv4f_clearcolor);<br>
                camera->setProjectionMatrixAsFrustum(-2.0,2.0,-2.0,2.0,5.0,50.0);<br>
        mv3f_eye.set(20.0f,20.0f,3.0f);<br>
        camera->setViewMatrixAsLookAt(mv3f_eye, mv3f_center, mv3f_up);<br>
        viewer->setCamera( camera );<br>
}<br>
<br>
void MultiCameras::camera_slave_create(osgViewer::Viewer *viewer)<br>
{<br>
        osg::ref_ptr<osg::Camera> camera = new osg::Camera;<br>
        camera->setGraphicsContext(gc);<br>
        camera->setViewport(0, 510, 650, 200);<br>
        GLenum buffer = traits->doubleBuffer ? GL_BACK : GL_FRONT;<br>
        camera->setDrawBuffer(buffer);<br>
        camera->setReadBuffer(buffer);<br>
        camera->setClearColor(mv4f_clearcolor);<br>
        camera->setProjectionMatrixAsFrustum(-8.0,8.0,-2.0,2.0,5.0,50.0);<br>
        mv3f_eye.set(20.0f,5.0f,0.0f);  //it doesn't work ?<br>
        camera->setViewMatrixAsLookAt(mv3f_eye, mv3f_center, mv3f_up);<br>
        viewer->addSlave(camera.get());<br>
}<br>
<br>
Thank you.<br>
<br>
------------------<br>
Read this topic online here:<br>
<a href="http://forum.openscenegraph.org/viewtopic.php?p=9479#9479" target="_blank">http://forum.openscenegraph.org/viewtopic.php?p=9479#9479</a><br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
</blockquote></div><br>