Hi Samuel,
Currently the stereo is implemented by the low level osgUtil::SceneView
class, which has a ComputeStereoMatricesCallback that you can use (from
include/osgUtil/SceneView) :
/** Callback for overidding the default method for compute the
offset projection and view matrices.*/
struct ComputeStereoMatricesCallback : public osg::Referenced
{
virtual osg::Matrixd computeLeftEyeProjection(const
osg::Matrixd& projection) const = 0;
virtual osg::Matrixd computeLeftEyeView(const osg::Matrixd&
view) const = 0;
virtual osg::Matrixd computeRightEyeProjection(const
osg::Matrixd& projection) const = 0;
virtual osg::Matrixd computeRightEyeView(const osg::Matrixd&
view) const = 0;
};
void setComputeStereoMatricesCallback(ComputeStereoMatricesCallback*
callback) { _computeStereoMatricesCallback=callback; }
ComputeStereoMatricesCallback* getComputeStereoMatricesCallback() {
return _computeStereoMatricesCallback.get(); }
const ComputeStereoMatricesCallback*
getComputeStereoMatricesCallback() const { return
_computeStereoMatricesCallback.get(); }
You can get access to the SceneView via the osgViewer::Renderer, and the
Render you'll find attached to the viewers main camera.
The other approach is to not use the low stereo support of the OSG, and just
implement the stereo yourself using Viewer slave Camera's, this is how I'd
tackle it these days. The low level SceneView stereo support dates back to
the early days of the OSG, and awaits replacement by provide convenience
functions for setup of stereo using slave Camera's in osgViewer.
Good luck,
Robert.
On Wed, Sep 16, 2009 at 9:13 AM, Samuel Jarque <[email protected]>wrote:
> Hi,
>
> At first, sorry if my english is bad.
> I'm using stereo mode in a project with horizontal split option and I need
> adjust the cameras of right and left eye. In other words, I need to move
> left or right eye camera X in vertical and Y in horizontal while the program
> is running without move the other eye camera and I don't find the code to
> access to these cameras.
>
> Thank you!
>
> Cheers,
> Samuel
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=17408#17408
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org