root/OpenSceneGraph/trunk/doc/stereo.html @ 1862

Revision 1862, 8.2 kB (checked in by robert, 12 years ago)

Fixes to documentions to refelect the move from osgGLUT to osgProducer.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
RevLine 
[637]1<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
[237]2<html>
3<head>
[637]4   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
[659]5   <meta name="GENERATOR" content="Mozilla/4.77 [en] (X11; U; Linux 2.4.3-20mdk i686) [Netscape]">
[651]6   <title>Native stereo support</title>
[237]7</head>
[637]8<body text="#000000" bgcolor="#FFFFFF" link="#0000EE" vlink="#551A8B" alink="#FF0000">
9<img SRC="images/OpenSceneGraphBanner_Distribution.jpg" height=77 width=640>
10<table>
[659]11<tr>
12<td><a href="index.html">Index</a></td>
[237]13
[659]14<td><a href="introduction.html">Introduction</a></td>
[637]15
[659]16<td><a href="contents.html">Contents</a></td>
[237]17
[659]18<td><a href="install.html">Install</a></td>
19
20<td><a href="dependencies.html">Dependencies</a></td>
21
[1862]22<td><a href="examples.html">examples</a></td>
[659]23
24<td><a href="data.html">Data</a></td>
25
[1862]26<td><a href="osgviewer.html">Viewer</a></td>
[659]27
28<td><a href="stereo.html">Stereo</a></td>
29
30<td><a href="plan.html">Plan</a></td>
31
32<td><a href="documentation.html">Reference Guides</a></td>
33</tr>
34</table>
35
36<h2>
37<u>Native Support for Stereo</u></h2>
38The OSG has support for anaglyphic stereo (i.e. red/green or red/cyan glasses),
39quad buffered stereo (i.e. active stereo using shutter glasses, or passive
40stereo using polarized projectors &amp; glasses) and horizontal and vertical
41split window stereo implementations. Almost all OSG applications have the
42potential for stereo support simply by setting the relevant environmental
43variables, or via command line arguments. Little or no code changes will
44be required, the support is handled transparently inside osgUtil::SceneView's
45handling of rendering. It is a simple as:
[1862]46<br><b>&nbsp;&nbsp;&nbsp; osgviewer --stereo cow.osg</b>
[659]47<p>If the user is planning to use head tracked stereo, or a cave then it
48is currently recommend to set it up via a VR toolkit such as VRjuggler,
49in this case refer to the VR toolkits handling of stereo, and keep all
50the OSG's stereo specific environment variables (below) set to OFF, or
51set the values to off within own your own applications.
52<br>
[593]53<hr>
[659]54<h3>
55The environmental variables of interest:</h3>
[237]56
[593]57<table>
[659]58<tr>
59<td><b>OSG_STEREO</b></td>
[237]60
[659]61<td><b>ON</b></td>
[237]62
[659]63<td>Turn stereo on&nbsp;</td>
64</tr>
[237]65
[659]66<tr>
67<td></td>
68
69<td><b>OFF</b></td>
70
71<td>Turn stereo off (default).&nbsp;</td>
72</tr>
73
74<tr>
75<td><b>OSG_STEREO_MODE</b></td>
76
77<td><b>ANAGLYPHIC</b></td>
78
79<td>Use anaglyphic stereo when in stereo (default).&nbsp;</td>
80</tr>
81
82<tr>
83<td></td>
84
85<td><b>QUAD_BUFFER</b></td>
86
87<td>Use quad buffered stereo when in stereo.&nbsp;</td>
88</tr>
89
90<tr>
91<td></td>
92
93<td><b>HORIZONTAL_SPLIT</b></td>
94
95<td>Use horizontal split stereo mode when in stereo&nbsp;</td>
96</tr>
97
98<tr>
99<td></td>
100
101<td><b>VERTICAL_SPLIT</b></td>
102
103<td>Use vertical split stereo mode when in stereo&nbsp;</td>
104</tr>
105
106<tr>
107<td><b>OSG_SCREEN_DISTANCE</b></td>
108
109<td><b>0.50</b></td>
110
111<td>Set the distance the viewer is from screen in metres (default shown)&nbsp;</td>
112</tr>
113
114<tr>
115<td><b>OSG_SCREEN_HEIGHT</b></td>
116
117<td><b>0.26</b></td>
118
119<td>Set the height if image on the screen in metres (default shown)&nbsp;</td>
120</tr>
121
122<tr>
[1159]123<td><b>OSG_EYE_SEPARATION</b></td>
[659]124
125<td><b>0.06</b></td>
126
127<td>Set the eye separation - interoccular distance (default shown.)&nbsp;</td>
128</tr>
129
130<tr>
[1159]131<td><b>OSG_SPLIT_STEREO_HORIZONTAL_SEPARATION</b></td>
[659]132
133<td><b>42</b></td>
134
135<td>Set the number of pixels between the left and right viewports (default
136shown).</td>
137</tr>
138
139<tr>
140<td><b>OSG_SPLIT_STEREO_HORIZONTAL_EYE_MAPPING</b></td>
141
142<td><b>LEFT_EYE_LEFT_VIEWPORT</b></td>
143
144<td>Set the left eye to render to left viewport, right eye to right viewport
145(default).&nbsp;</td>
146</tr>
147
148<tr>
149<td></td>
150
151<td><b>LEFT_EYE_RIGHT_VIEWPORT</b></td>
152
153<td>Set the left eye to render to right viewport, right eye to left viewport.&nbsp;</td>
154</tr>
155
156<tr>
[1159]157<td><b>OSG_SPLIT_STEREO_VERTICAL_SEPARATION</b></td>
[659]158
159<td><b>42</b></td>
160
161<td>Set the number of pixels between the top and bottom viewports (default
162shown).</td>
163</tr>
164
165<tr>
166<td><b>OSG_SPLIT_STEREO_VERTICAL_EYE_MAPPING</b></td>
167
168<td><b>LEFT_EYE_TOP_VIEWPORT</b></td>
169
170<td>Set the left eye to render to top viewport, right eye to bottom viewport
171(default).&nbsp;</td>
172</tr>
173
174<tr>
175<td></td>
176
177<td><b>LEFT_EYE_BOTTOM_VIEWPORT</b></td>
178
179<td>Set the left eye to render to bottom viewport, right eye to top viewport.&nbsp;</td>
180</tr>
[238]181</table>
182
[593]183<hr>
[659]184<h3>
185Command line arguments can be used to override these settings:</h3>
[238]186
[659]187<table>
188<tr>
189<td><b>-stereo</b></td>
[238]190
[659]191<td></td>
[238]192
[659]193<td>Switch on stereo.&nbsp;</td>
194</tr>
[238]195
[659]196<tr>
197<td><b>-stereo</b></td>
[238]198
[659]199<td><b>ON</b></td>
[238]200
[659]201<td>Switch on stereo.&nbsp;</td>
202</tr>
[238]203
[659]204<tr>
205<td></td>
206
207<td><b>OFF</b></td>
208
209<td>Switch off stereo.&nbsp;</td>
210</tr>
211
212<tr>
213<td></td>
214
215<td><b>ANAGLYPHIC</b></td>
216
217<td>Switch on ANAGLYPHIC stereo.&nbsp;</td>
218</tr>
219
220<tr>
221<td></td>
222
223<td><b>QUAD_BUFFER</b></td>
224
225<td>Switch on QUAD_BUFFER stereo.&nbsp;</td>
226</tr>
227
228<tr>
229<td></td>
230
231<td><b>VERTICAL_SPLIT</b></td>
232
233<td>Switch on VERTICAL_SPLIT stereo.&nbsp;</td>
234</tr>
235
236<tr>
237<td></td>
238
239<td><b>HORIZONTAL_SPLIT</b></td>
240
241<td>Switch on VERTICAL_SPLIT stereo.&nbsp;</td>
242</tr>
243</table>
244
245<hr>
246<h3>
247Examples:</h3>
248To invoke stereo from the comandline:
[1862]249<br><b>&nbsp;&nbsp;&nbsp; osgviewer -stereo cow.osg</b>
[659]250<p>To invoke quad buffered stereo from the commandline:
[1862]251<br><b>&nbsp;&nbsp;&nbsp; osgviewer -stereo QUAD_BUFFER cow.osg</b>
[659]252<p>To force all apps to start up in quad buffered stereo (if system supports
253it)
254<br><b>&nbsp;&nbsp;&nbsp; export OSG_STEREO=ON</b>
255<br><b>&nbsp;&nbsp;&nbsp; export OSG_STEREO_MODE=QUAD_BUFFER</b>
[1862]256<br><b>&nbsp;&nbsp;&nbsp; osgviewer cow.osg</b>
[659]257<p>To set quad buffered stereo to the default, but use the commandline
258to switch stereo on:
259<br><b>&nbsp;&nbsp;&nbsp; export OSG_STEREO=OFF</b>
260<br><b>&nbsp;&nbsp;&nbsp; export OSG_STEREO_MODE=QUAD_BUFFER</b>
[1862]261<br><b>&nbsp;&nbsp;&nbsp; osgviewer -stereo cow.osg</b>
[659]262<p>
263<hr>
264<h3>
265Size matters:</h3>
266For appropriate depth perception the stereo code creates separate left
267and eye views, both the frustum and modelview are shifted to account for
268the separate eye views.&nbsp; To achieve the right amount of adjustment
269the OSG requires the users eye separation, the distance from the eyes to
270the screen and the height of the screen.&nbsp; The OSG will use the defaults
271of 0.05m,0.5m and 0.26m respectively which are assumed to be reasonable
272defaults for most users workstation configurations, note the OSG_SCREEN_HEIGHT
273is the image height rather than total size of your monitor/display surface.&nbsp;
274For the best stereo effects please measure these values and set them up
275via the environmental variables.&nbsp; Once set the views you get should
276give improved depth perception.&nbsp; A good way of measuring how well
277you are configured for your display is to fly away from objects (using
278the FlightManipulator for instance, but not the TrackballManipulator, see
279below) so that they go of toward infinity. As they move away the offset
280between the two images should tend towards your eye separation, if you
281achieve this then the object will be perceived as at infinity.
282<br>
283<hr>
284<h3>
285Camera Manipulator Modes:</h3>
286There are three osgUtil::CameraManipulator's which come with osgUtil, which
[1862]287operate as a Trackball, Drive and Flight modes of interaction (see osgviewer.html
[659]288for how to invoke them in the scene graph viewer). The osgUtil::Trackball
289Manipulator automatically scales the fusion distance to that which will
290fusion on center point of rotation - this will appear at the middle of
291the monitor at the monitors depth. Whereas, the osgUtil::DriveManipualtor,
292osgUtil::FlightManipulator scale the fusion distance to the distance the
293viewer is from the screen, the results in a perception that the virtual
294world is scaled to physical world, this is clearly better for simulators
295and alike. You can control the fusion of the image in these two modes via
296the osg::Camera::setFusionDistanceMode(FusionDistanceMode mode) where mode
297can be osg::Camera::PROPORTIONAL_TO_LOOK_DISTANCE (used by Trackball) or
298osg::Camera::PROPORTIONAL_TO_SCREEN_DISTANCE (used by Drive and Flight),
299and osg::Camera::setFusionDistanceRatio(float). See include/osg/Camera
300for further details, and the camera manipulators for implementation details.
301The fusion distance ratio defaults to 1.0 but can be biased to move objects
302out or into screen, they will also appear to get smaller and larger respectively.
303The camera manipulators allow the user to alter this value at runtime via
304the '+' and '-' keys.
[237]305</body>
306</html>
Note: See TracBrowser for help on using the browser.