<div dir="auto">Hi everyone,</div><div dir="auto"><br></div><div dir="auto">I am fairly new to OSG and am trying to use slave cameras to view a scene from slightly different angles, of which will overlap slightly. I am starting with the OSG 3.0 Cookbook example from chapter 4, #2 (source code at <span style="font-family:Helvetica;font-size:12pt"><a href="https://github.com/xarray/osgRecipes">https://github.com/xarray/osgRecipes</a>).</span><br>Instead of the full 9 cameras, I am working with just two cameras that I am aligning side by side, with no rotation as my first test, using the following approximate code. In this example, I am attempting to show half of a 3D model on each slave camera.</div><div dir="auto"><br></div><div dir="auto">Slave1:</div><div dir="auto">osg::Matrix projOffset = osg::Matrix::translate(1,0,0);</div><div dir="auto">viewer.addSlave(camera, projOffset, osg::Matrix(), true);</div><div dir="auto">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<meta name="Generator" content="Cocoa HTML Writer">
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px}
span.s1 {font-family: 'Helvetica'; font-weight: normal; font-style: normal; font-size: 12.00pt}
</style>
<p class="p1"><br></p><p class="p1">Slave2:</p><div dir="auto">osg::Matrix projOffset = osg::Matrix::translate(-1,0,0);</div><p class="p1"></p><div dir="auto"></div><p></p><div dir="auto" style="color:rgb(0,0,0);font-family:-apple-system,HelveticaNeue;font-size:16px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">viewer.addSlave(camera, projOffset, osg::Matrix(), true);</div></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">This seems to work fine, with half the 3D model on the left screen, half on the right. </div><div dir="auto"><br></div><div dir="auto">When i add in a rotation term, for example, on slave 2:</div><div dir="auto"><br></div><div dir="auto"><div dir="auto"><div dir="auto">osg::Matrix projOffset = osg::Matrix::rotate(osg::DegreesToRadians(15), osg::Vec3D(0,1,0)) * osg::Matrix::translate(-.8,0,0);</div><div dir="auto">viewer.addSlave(camera, projOffset, osg::Matrix(), true);</div><div dir="auto"><br></div><div dir="auto">all I see is a tiny sliver of the model. I have tried rotating on different axis (placing the 1 in a different spot in the vector), different translations, etc. The Z axis seems to work fine, but the X and Y axis are not working properly. I am thinking it may be due to an improperly setup frustrum, but am having trouble setting it.</div><div dir="auto"><br></div><div dir="auto">I would appreciate any kind of information as to what I may be doing wrong or should be looking at. </div><div dir="auto"><br></div><div dir="auto">Thank you!</div><div dir="auto"><br></div><div dir="auto">Jim</div></div></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><br></div><style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px}
span.s1 {font-family: 'Helvetica'; font-weight: normal; font-style: normal; font-size: 12.00pt}
</style>