From fb5fee6c5ee79c6e9080c5a29151dbf1355ce101 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sat, 22 Dec 2001 22:30:57 +0000 Subject: [PATCH] Updates to keep things compiling under Windows. Also cleaned up the new stereo.html docs. --- doc/stereo.html | 179 +++++++++++++++++++------- src/Demos/osgimpostor/osgimpostor.cpp | 2 +- src/Demos/osgreflect/osgreflect.cpp | 2 +- src/Demos/osgviews/osgviews.cpp | 2 +- src/Demos/sgv/sgv.cpp | 2 +- 5 files changed, 139 insertions(+), 48 deletions(-) diff --git a/doc/stereo.html b/doc/stereo.html index 399a28f35..1265f6578 100644 --- a/doc/stereo.html +++ b/doc/stereo.html @@ -2,75 +2,166 @@ - + OSG Documentation - -

Stereo

-The OSG has support for stereo out of the box. Currently both anaglyphic stereo (i.e. red/green glasses) -and quad buffered stereo (i.e. active stereo using shutter glasses, or passive stereo using polarised -projectors & glasses). It is planned to extend this support horizontal and -virtual window split based stereo implementations. +The OSG has support for stereo out of the box. Currently both anaglyphic +stereo (i.e. red/green or red/cyan glasses) and quad buffered stereo (i.e. +active stereo using shutter glasses, or passive stereo using polarised +projectors & glasses). It is planned to extend this support horizontal +and virtical spli window based stereo implementations. +

Almost all OSG applications have the potential for stereo support simply +by setting the relevent environmental variables, or via command line arguments. +Little or no code changes will be required, the support is handled transparently +inside osgUtil::SceneView's handling of rendering. +

If the user is planning to use head tracked stereo, or a cave then it +is currently recommend to set it up via a VR toolkit such as VRjuggler, +in this case refer to the VR toolkits handling of stereo, and do not invoke +the OSG's native support, i.e. keep all the OSG's stereo specific environment +varibles (below) set to OFF, or set the values to off within own your own +applications. +

+The environmental variables of interest:

-Almost all OSG applications have the potential for support simply by setting -the relevent environmental variables, or via command line arguments. Little or -no code changes will be required, the support is handled transparently inside -osgUtil::SceneView's handling of rendering. + + + -If the user is planning to use head tracked stereo, or a cave then it is -currently recommend to set it via a VR toolkit such as VRJuggler, in this -case refer to the VR toolkits handling of stereo, and do not invoke the -OSG's native support, i.e. keep all the stereo specific environment set to -OFF, or set the values to off within there own applications. + -The environmental variables of interest: + + - OSG_STEREO ON turn stereo on. - OSG_STEREO OFF turn stereo off (default) + + - OSG_STEREO_MODE ANAGLYPHIC use anaglyphic stereo when in stereo (default). - OSG_STEREO_MODE QUAD_BUFFER use quad buffered stereo when in stereo. + - OSG_SCREEN_DISTANCE 0.50 set the distance the viewer is from screen in metres (default shown) - OSG_SCREEN_HEIGHT 0.26 set the height if image on the screen in metres (default shown) + + -Command line arguments can be used to override these settings: + + - -stereo Switch on stereo. - -stereo ON Switch on stereo. - -stereo OFF Switch off stereo. - -stereo ANAGLYPHIC Switch on ANAGLYPHIC stereo. - -stereo QUAD_BUFFER Switch on QUAD_BUFFER stereo. + -Examples: + + - To invoke stereo from the comandline: + + - sgv -stereo cow.osg + - To invoke quad buffered stereo from the commandline: + + - sgv -stereo QUAD_BUFFER cow.osg + + - To force all apps to start up in quad buffered stereo (if system supports it) + - export OSG_STEREO=ON - export OSG_STEREO_MODE=QUAD_BUFFER + + - sgv cow.osg + + - To set quad buffered stereo to the default, but use the commandline to - switch stereo on: + - export OSG_STEREO=OFF - export OSG_STEREO_MODE=QUAD_BUFFER + + - sgv -stereo cow.osg - + + + + + + +
OSG_STEREOONturn stereo on.
OSG_STEREOOFFturn stereo off (default)
OSG_STEREO_MODEANAGLYPHICuse anaglyphic stereo when in stereo (default).
OSG_STEREO_MODEQUAD_BUFFERuse quad buffered stereo when in stereo.
OSG_SCREEN_DISTANCE0.50set the distance the viewer is from screen in metres (default shown)
OSG_SCREEN_HEIGHT0.26set the height if image on the screen in metres (default shown)
OSG_EYE_SEPERATION0.05set the eye seperation - interoccular distance (default shown.)
+ +

+Command line arguments can be used to override these settings:

+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
-stereoSwitch on stereo.
-stereoONSwitch on stereo.
-stereoOFFSwitch off stereo.
-stereoANAGLYPHICSwitch on ANAGLYPHIC stereo.
-stereoQUAD_BUFFERSwitch on QUAD_BUFFER stereo.
+ +

+Examples:

+To invoke stereo from the comandline: +
    sgv -stereo cow.osg +

To invoke quad buffered stereo from the commandline: +
    sgv -stereo QUAD_BUFFER cow.osg +

To force all apps to start up in quad buffered stereo (if system supports +it) +
    export OSG_STEREO=ON +
    export OSG_STEREO_MODE=QUAD_BUFFER +
    sgv cow.osg +

To set quad buffered stereo to the default, but use the commandline +to switch stereo on: +
    export OSG_STEREO=OFF +
    export OSG_STEREO_MODE=QUAD_BUFFER +
    sgv -stereo cow.osg +
  +

+Size matters:

+For appropriate depth perception the stereo code creates seperate left +and eye views, both the frustum and modelview are shifted to account for +the seperate eye views.  To achieve the right amount of adjustment +the OSG requires the users eye seperation, the distance from the eyes to +the screen and the height of the screen.  The OSG will use the defaults +of 0.05m,0.5m and 0.26m respectively which are assumed to be reasonable +defaults for most users workstation configurations, note the OSG_SCREEN_HEIGHT +is the image height rather than total size of your monitor/display surface.  +For the best stereo effects please measure these values and set them up +via the environmental variables.  Once set the views you get should +give improved depth perception. +
  +
  +
  diff --git a/src/Demos/osgimpostor/osgimpostor.cpp b/src/Demos/osgimpostor/osgimpostor.cpp index e82110f10..be517ad48 100644 --- a/src/Demos/osgimpostor/osgimpostor.cpp +++ b/src/Demos/osgimpostor/osgimpostor.cpp @@ -14,7 +14,7 @@ #include -void write_usage(ostream& out,const std::string& name) +void write_usage(std::ostream& out,const std::string& name) { out << std::endl; out <<"usage:"<< std::endl; diff --git a/src/Demos/osgreflect/osgreflect.cpp b/src/Demos/osgreflect/osgreflect.cpp index e6e9d2d78..cfe034acb 100644 --- a/src/Demos/osgreflect/osgreflect.cpp +++ b/src/Demos/osgreflect/osgreflect.cpp @@ -99,7 +99,7 @@ osg::Drawable* createMirrorSurface(float xMin,float xMax,float yMin,float yMax,f return gset; } -void write_usage(ostream& out,const std::string& name) +void write_usage(std::ostream& out,const std::string& name) { out << std::endl; out <<"usage:"<< std::endl; diff --git a/src/Demos/osgviews/osgviews.cpp b/src/Demos/osgviews/osgviews.cpp index 8ca24ea40..e7b32b2dd 100644 --- a/src/Demos/osgviews/osgviews.cpp +++ b/src/Demos/osgviews/osgviews.cpp @@ -14,7 +14,7 @@ #include -void write_usage(ostream& out,const std::string& name) +void write_usage(std::ostream& out,const std::string& name) { out << std::endl; out <<"usage:"<< std::endl; diff --git a/src/Demos/sgv/sgv.cpp b/src/Demos/sgv/sgv.cpp index 5459f565c..807c6e72d 100644 --- a/src/Demos/sgv/sgv.cpp +++ b/src/Demos/sgv/sgv.cpp @@ -16,7 +16,7 @@ #include -void write_usage(ostream& out,const std::string& name) +void write_usage(std::ostream& out,const std::string& name) { out << std::endl; out <<"usage:"<< std::endl;