[osg-submissions] Fix for stereo viewport settings

Farshid Lashkari flashk at gmail.com
Wed Jun 18 18:59:24 PDT 2008


Hi Robert,

I noticed some problems when setting up CameraNodes that inherit
viewport settings in stereo mode. It seems that the SceneView::cull()
method will pass the full size viewport to the left/right
cullvisitors, instead of the modified stereo viewport. I made quite a
few changes to SceneView to fix the issue. The SceneView::cullStage()
method will now receive the viewport as an argument, instead of using
the global viewport. The SceneView::cull() method will pass the
modifed viewport to cullStage when rendering in stereo.

There are 2 new private methods computeLeftEyeViewport() and
computeRightEyeViewport() that will compute the stereo viewports. I
also modified the draw() function so it applies the correct viewport
to the prerender stages. These changes are only necessary for
horizontal/vertical split stereo.

I'm still using OSG 1.2 (I really need to upgrade!), so I tried my
best to port the changes to the latest SVN version. I'm almost sure I
screwed something up in the process, so I apologize in advance.

Cheers,
Farshid
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SceneView
Type: application/octet-stream
Size: 28544 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-submissions-openscenegraph.org/attachments/20080618/879164a5/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SceneView.cpp
Type: text/x-c++src
Size: 67040 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-submissions-openscenegraph.org/attachments/20080618/879164a5/attachment-0001.cpp>


More information about the osg-submissions mailing list