Hi Thanh,

In addition of what J-S said, you can also recover the options passed to your 
program with the ArgumentParser and then initialize the viewer with them:

int main(int argc, char **argv){
osg::ArgumentParser args( &argc, argv);
osgViewer::Viewer v(args);

...

}

this will make your program mimic osgviewer behaviour, that is, you can 
run "myprogram --stereo" to get stereo rendering. The use of one or the other 
way depends on which fits best to your application.

Alberto

El Jueves 30 Octubre 2008ES 20:50:28 Jean-Sébastien Guay escribió:
> Hello Thanh,
>
> > It's very easy to load a model using stereo display by add an argument
> > "--stereo" on console line, such as
> > osgviewer --stereo cow.osg
> >
> > but how can I implement the stereo display on my application? I have
> > searched all over but can not find it anywhere.
>
> Check osg::DisplaySettings::setStereo. You would do for example
>
> osg::DisplaySettings::instance()->setStereo(true);
> osg::DisplaySettings::instance()->setStereoMode(...);
>
> before creating your graphics context (or before the viewer creates it).
>
> > One more question: Where can I find the osgviewer source code?
> > osgViewer/Viewer.cpp is not that, right?
>
> OpenSceneGraph/applications/osgViewer/osgviewer.cpp
>
> But it's pretty simple, you won't find for example the --STEREO option
> there, it's checked somewhere else. I suggest you do a "find in files"
> to find out where.
>
> Hope this helps,
>
> J-S


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

Reply via email to