Stereo camera node. More...
#include <Inventor/nodes/SoStereoCamera.h>
Public Member Functions | |
virtual SoType | getTypeId () const |
SoStereoCamera () | |
Static Public Member Functions | |
static SoType | getClassTypeId () |
Public Attributes | |
SoSFFloat | offset |
SoSFFloat | balance |
SoSFBool | balanceNearFrac |
SoSFBool | absoluteAdjustments |
Deprecated | |
| |
virtual SoDEPRECATED void | setStereoAdjustment (float adjustment) |
virtual SoDEPRECATED void | setStereoAbsoluteAdjustments (SbBool absolute) |
virtual SoDEPRECATED void | setBalanceAdjustment (float adjustment, SbBool nearFrac=false) |
virtual SoDEPRECATED void | allowStereo (SbBool allowed) |
Stereo camera node.
A stereo camera defines a specific perspective camera for stereo support.
This class defines fields to store the stereo settings related to the camera:
See the base class SoPerspectiveCamera for more information about the inherited fields.
offset | 0.7 |
balance | 1.0 |
balanceNearFrac | FALSE |
absoluteAdjustments | FALSE |
SbViewVolume, SoPerspectiveCamera, SoCameraInteractor
SoStereoCamera::SoStereoCamera | ( | ) |
Creates a stereo camera node with default settings.
virtual SoDEPRECATED void SoStereoCamera::allowStereo | ( | SbBool | allowed | ) | [virtual] |
Allows the camera to render in stereo.
Do nothing here as this camera is always allowed to render in stereo.
Reimplemented from SoCamera.
static SoType SoStereoCamera::getClassTypeId | ( | ) | [static] |
Returns the type identifier for this class.
Reimplemented from SoPerspectiveCamera.
virtual SoType SoStereoCamera::getTypeId | ( | ) | const [virtual] |
Returns the type identifier for this specific instance.
Reimplemented from SoPerspectiveCamera.
virtual SoDEPRECATED void SoStereoCamera::setBalanceAdjustment | ( | float | adjustment, | |
SbBool | nearFrac = false | |||
) | [virtual] |
Reimplemented from SoCamera.
virtual SoDEPRECATED void SoStereoCamera::setStereoAbsoluteAdjustments | ( | SbBool | absolute | ) | [virtual] |
Reimplemented from SoCamera.
virtual SoDEPRECATED void SoStereoCamera::setStereoAdjustment | ( | float | adjustment | ) | [virtual] |
Reimplemented from SoCamera.
Specifies if stereo adjustments are absolute.
FALSE by default.
The default non-absolute mode allows the stereo settings to be valid over a range of different view volume settings. If you chose absolute mode, you are responsible for modifying the stereo settings (if necessary) when the view volume changes.
When absolute mode is TRUE, stereo offset and balance are used as shown in the following pseudo-code for the right eye view:
StereoCameraOffset = offset.getValue(); FrustumAsymmetry = balance.getValue(); glTranslated (-StereoCameraOffset, 0, 0); glFrustum (FrustumLeft + FrustumAsymmetry, FrustumRight + FrustumAsymmetry, FrustumBottom, FrustumTop, NearClipDistance, FarClipDistance);
The left eye view is symmetric.
When absolute mode is FALSE, stereo offset and balance are used as shown in the following pseudo-code for the right eye view:
Xrange is right minus left (i.e., first two arguments of glFrustum) and multiply that difference by the ratio of the distance to the desired plane of zero parallax to the near clipping plane distance.
StereoCameraOffset = Xrange * 0.035 * offset.getValue(); FrustumAsymmetry = -StereoCameraOffset * balance.getValue(); ZeroParallaxDistance = (NearClipDistance + FarClipDistance)/0.5; FrustumAsymmetry *= NearClipDistance / ZeroParallaxDistance; glTranslated (-StereoCameraOffset, 0, 0); glFrustum (FrustumLeft + FrustumAsymmetry, FrustumRight + FrustumAsymmetry, FrustumBottom, FrustumTop, NearClipDistance, FarClipDistance);
The left eye view is symmetric.
The stereo balance (the position of the zero parallax plane).
Default balance is 1.0.
Specifies whether the balance value is defined as a fraction of the camera near distance.
Note: Since the projection matrix always depends on the camera's near plane, in some cases it may be necessary to detect changes to the camera near plane and adjust by setting a new stereo balance value. Open Inventor will make these adjustments automatically if the balanceNearFrac field is set to TRUE. In this case the stereo balance value is defined as a fraction of the camera near distance.
Default nearFrac is FALSE.
The stereo offset (the distance of each eye from the camera position).
The right eye is moved plus offset and the left eye is moved minus offset. Default is 0.7.