- Timestamp:
- 11/24/08 17:02:20 (4 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osgsidebyside/osgsidebyside.cpp
r9229 r9232 167 167 wsi->getScreenResolution(osg::GraphicsContext::ScreenIdentifier(0), width, height); 168 168 169 170 169 171 // Not fullscreen 170 172 width /= 2; … … 195 197 } 196 198 197 double aspectRatioScale = 1.0;198 199 199 200 osg::Camera* master = viewer.getCamera(); 201 202 // get the default settings for the camera 200 203 double fovy, aspectRatio, zNear, zFar; 201 204 master->getProjectionMatrixAsPerspective(fovy, aspectRatio, zNear, zFar); 202 master->setProjectionResizePolicy(osg::Camera::VERTICAL); 203 fovy = 90; 204 aspectRatio = 1; 205 master->setProjectionMatrixAsPerspective(fovy, aspectRatio, zNear, zFar); 206 207 double h = osg::absolute(tan(osg::DegreesToRadians(fovy / 2))); 208 double w = h * aspectRatio; 209 double fovx = osg::absolute(osg::RadiansToDegrees(atan(w)) * 2); 205 206 // reset this for the actual apsect ratio of out created window 207 double windowAspectRatio = double(width)/double(height); 208 master->setProjectionMatrixAsPerspective(fovy, windowAspectRatio, 1.0, 10000.0); 210 209 211 210 master->setName("MasterCam"); … … 219 218 camera->setDrawBuffer(buffer); 220 219 camera->setReadBuffer(buffer); 221 viewer.addSlave(camera.get(), osg::Matrixd (), osg::Matrixd());220 viewer.addSlave(camera.get(), osg::Matrixd::scale(1.0,0.5,1.0), osg::Matrixd()); 222 221 223 222 camera = new osg::Camera; … … 229 228 camera->setDrawBuffer(buffer); 230 229 camera->setReadBuffer(buffer); 231 viewer.addSlave(camera.get(), osg::Matrixd (), osg::Matrixd());230 viewer.addSlave(camera.get(), osg::Matrixd::scale(1.0,0.5,1.0), osg::Matrixd()); 232 231 } 233 232
