The stereo model in Open Inventor takes advantage of the characteristics of the asymmetric frustum in order to obtain a high quality geometric stereo effect. Two parameters are adjusted to create the stereo effect: the view frustum orientation and the camera translation.
The depth of stereo – how deep the scene appears to be when the stereo is activated – is adjusted via the offset, that is, the separation between the left and the right cameras representing the separation between the viewer’s eyes. The wider the offset, the deeper the scene appears to be. This is a simple adjustment done by translating the camera along the horizontal axis (meaning the axis along which are the eyes of the actual person looking at the screen). The offset is calculated as a percentage of the view volume itself.
Not only do the cameras need to be separated to the “left” and to the “right,” but we also need to represent the fact that the eyes are looking at the same object at the same time. There are two ways to do this:
The second approach solves this. It also allows an interesting effect to be applied without distortion: by increasing or decreasing the frustum asymmetry, the scene will appear to be moved with respect to the screen plane. This is the parallax balance. By default, the zero parallax plane is set at the middle of the view volume. Therefore, by default, a scene will appear with its center positioned at the screen level, some parts will appear in front of the screen, other parts will appear behind the screen. Increasing the frustum asymmetry will produce a positive parallax, with the scene being pushed behind the screen, whereas decreasing the asymmetry will produce a negative parallax, the scene being pulled in front of the screen.
Both the frustum asymmetry and the camera offset are computed according to the default view volume. This means that there is no external intervention to set the stereo. However, it is possible to adjust the two parameters if one wants to change the parallax plane or to deepen or flatten the scene. Adjustment values are given as a factor of the default parameter. Therefore, the neutral value for both parameters is 1 and the null value is 0. For the offset, the domain of values is zero and higher, though above 3 the view might begin to be uncomfortable. For the parallax, any value can be provided, though below -2 and above 4 the view might begin to be uncomfortable too.
This section does not refer to the activation of the stereo in general, but specifically to setting the camera in stereo mode, meaning adapting the projection matrix to fit the view volume requirements for stereo. For stereo activation, see Displaying in Stereo. Note that in most cases it is more convenient to use the viewer methods.
The node SoCamera provides some methods that allow the projection matrix to be set in stereo mode, as well as to adjust the stereo settings:
C++ :
C# :
When rendering in stereo, first set the stereo mode to left (or right) view, render the scene, set the stereo mode to right (or left) view, render the scene again, then put the camera back into monoscopic mode:
C++ :
C# :
The adjustment of the parameters must be applied before the first render operation. The available methods are:
C++ :
C# :
Remember that all this applies to the projection matrix. This really means that, at that point, only the camera is set in stereo mode. Note also that convenience methods for stereo adjustment are available for all viewers. On a viewer object, you can call these methods:
C++ :
C# :
Unfortunately, in the case of an orthographic camera, the view volume cannot be reoriented the same way as for a perspective camera. Therefore, in the case of an orthographic camera, instead of reorienting the view volume, the cameras are rotated toward the point of focus as it is defined when the mode is monoscopic. Meaning that the geometric quality obtained with the asymmetric frustum in perspective mode cannot be reached in orthographic mode. However, like the perspective mode, the offset is still automatically defined according to the view volume. Therefore, the stereo parameters can be adjusted the same as in perspective mode.