Hi,

The specs on the HMD that I am working with calls for the view on each eye be 
rotated outward by 13 degrees. However when I do this I can see what appears to 
be a clipping plane. If both cameras are looking straight ahead, there is not a 
problem. However I do need to rotate them outward.

            int xoffset = 40;
            int yoffset = 40;
        
            // left window + left slave camera
            {
                osg::ref_ptr<osg::GraphicsContext::Traits> traits = new 
osg::GraphicsContext::Traits;
                traits->x = xoffset + 0;
                traits->y = yoffset + 0;
                traits->width = 600;
                traits->height = 480;
                traits->windowDecoration = true;
                traits->doubleBuffer = true;
                traits->sharedContext = 0;
        
                osg::ref_ptr<osg::GraphicsContext> gc = 
osg::GraphicsContext::createGraphicsContext(traits.get());
        
                osg::ref_ptr<osg::Camera> camera = new osg::Camera;
                camera->setGraphicsContext(gc.get());
                camera->setViewport(new osg::Viewport(0,0, traits->width, 
traits->height));
                GLenum buffer = traits->doubleBuffer ? GL_BACK : GL_FRONT;
                camera->setDrawBuffer(buffer);
                camera->setReadBuffer(buffer);

                this->addSlave(camera.get(), osg::Matrixd::rotate(-13, 
Vec3f(0,1,0)), osg::Matrixd());
            }
           
            // right window + right slave camera
            {
                osg::ref_ptr<osg::GraphicsContext::Traits> traits = new 
osg::GraphicsContext::Traits;
                traits->x = xoffset + 600;
                traits->y = yoffset + 0;
                traits->width = 600;
                traits->height = 480;
                traits->windowDecoration = true;
                traits->doubleBuffer = true;
                traits->sharedContext = 0;
        
                osg::ref_ptr<osg::GraphicsContext> gc = 
osg::GraphicsContext::createGraphicsContext(traits.get());
        
                osg::ref_ptr<osg::Camera> camera = new osg::Camera;
                camera->setGraphicsContext(gc.get());
                camera->setViewport(new osg::Viewport(0,0, traits->width, 
traits->height));
                GLenum buffer = traits->doubleBuffer ? GL_BACK : GL_FRONT;
                camera->setDrawBuffer(buffer);
                camera->setReadBuffer(buffer);
                this->addSlave(camera.get(), osg::Matrixd::rotate(13, 
Vec3f(0,1,0)), osg::Matrixd());
            }


Thank you!

Cheers,
Robert

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=36124#36124





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to