![]() |
scg3
0.6
|
A perspective stereo camera (composite node). More...
#include "StereoCamera.h"
Public Member Functions | |
| StereoCamera () | |
| virtual | ~StereoCamera () |
| void | init (GLfloat near, GLfloat far, GLfloat screenDist, GLfloat screenHeight, GLfloat interOcularDist) |
| void | initBourke (GLfloat fovyDeg, GLfloat near, GLfloat far, GLfloat screenDist, GLfloat interOcularFactor) |
| virtual const glm::mat4 & | getProjection () |
| virtual const glm::mat4 & | getViewTransform (RenderState *renderState) |
| virtual void | updateProjection () |
| virtual void | render (RenderState *renderState) |
Public Member Functions inherited from scg::Camera | |
| Camera () | |
| virtual | ~Camera () |
| const glm::vec3 & | getPosition () const |
| Camera * | setPosition (const glm::vec3 &position) |
| const glm::quat & | getOrientation () const |
| Camera * | setOrientation (const glm::quat &orientation) |
| const glm::vec3 & | getViewDirection () const |
| GLfloat | getCenterDist () const |
| virtual Camera * | setMatrix (const glm::mat4 &matrix) |
| virtual Camera * | translate (glm::vec3 translation) |
| virtual Camera * | rotateRad (GLfloat angleRad, glm::vec3 axis) |
| virtual Camera * | rotate (GLfloat angleDeg, glm::vec3 axis) |
| virtual Camera * | scale (glm::vec3 scaling) |
| Camera * | dolly (GLfloat distance) |
| Camera * | rotateAzimuthRad (GLfloat angleRad) |
| Camera * | rotateAzimuth (GLfloat angleDeg) |
| Camera * | rotateElevationRad (GLfloat angleRad) |
| Camera * | rotateElevation (GLfloat angleDeg) |
| Camera * | rotatePitchRad (GLfloat angleRad) |
| Camera * | rotatePitch (GLfloat angleDeg) |
| Camera * | rotateRollRad (GLfloat angleRad) |
| Camera * | rotateRoll (GLfloat angleDeg) |
| Camera * | rotateYawRad (GLfloat angleRad) |
| Camera * | rotateYaw (GLfloat angleDeg) |
| bool | isDrawCenter () const |
| Camera * | setDrawCenter (bool isDrawCenter) |
| void | accept (Traverser *traverser) |
| virtual void | acceptPost (Traverser *traverser) |
| virtual void | renderPost (RenderState *renderState) |
Public Member Functions inherited from scg::Transformation | |
| Transformation () | |
| virtual | ~Transformation () |
| const glm::mat4 & | getMatrix () const |
Public Member Functions inherited from scg::Composite | |
| Composite () | |
| virtual | ~Composite ()=0 |
| virtual void | destroy () |
| Composite * | addChild (NodeSP child) |
| Composite * | removeChild (Node *node, bool &result) |
| Composite * | removeChild (Node *node) |
| virtual void | traverse (Traverser *traverser) |
Public Member Functions inherited from scg::Node | |
| Node () | |
| virtual | ~Node ()=0 |
| virtual void | clear () |
| int | getNCores () const |
| const std::string & | getMetaInfo (const std::string &key) const |
| void | setMetaInfo (const std::string &key, const std::string &value) |
| bool | isVisible () const |
| void | setVisible (bool isVisible=true) |
Static Public Member Functions | |
| static StereoCameraSP | create () |
Static Public Member Functions inherited from scg::Transformation | |
| static TransformationSP | create () |
Protected Attributes | |
| GLint | eyeFactor_ |
| GLfloat | near_ |
| GLfloat | far_ |
| GLfloat | screenDist_ |
| GLfloat | screenHalfWidth_ |
| GLfloat | screenHalfHeight_ |
| GLfloat | interOcularHalfDist_ |
Protected Attributes inherited from scg::Camera | |
| glm::mat4 | projection_ |
| glm::mat4 | viewTransform_ |
| glm::vec3 | eyePt_ |
| glm::vec3 | centerPt_ |
| GLfloat | centerDist_ |
| glm::vec3 | viewDir_ |
| glm::vec3 | upDir_ |
| glm::vec3 | rightDir_ |
| glm::quat | orientation_ |
| bool | isDrawCenter_ |
Protected Attributes inherited from scg::Transformation | |
| glm::mat4 | matrix_ |
Protected Attributes inherited from scg::Composite | |
| NodeSP | leftChild_ |
Protected Attributes inherited from scg::Node | |
| NodeSP | rightSibling_ |
| Composite * | parent_ |
| std::vector< CoreSP > | cores_ |
| bool | isVisible_ |
| std::unordered_map< std::string, std::string > | metaInfo_ |
Additional Inherited Members | |
Protected Member Functions inherited from scg::Camera | |
| virtual void | update_ () |
Protected Member Functions inherited from scg::Node | |
| void | addSibling_ (NodeSP sibling) |
| void | removeSibling_ (Node *node, bool &result) |
| void | processCores_ (RenderState *renderState) |
| void | postProcessCores_ (RenderState *renderState) |
A perspective stereo camera (composite node).
Experimental: Does not work with multiple render passes since eye is switched with each call of render().
Initial parameters (Bourke method):
Definition at line 50 of file StereoCamera.h.
| scg::StereoCamera::StereoCamera | ( | ) |
Constructor.
|
virtual |
Destructor.
|
static |
Create shared pointer.
|
virtual |
Get projection matrix for current (left or right) eye.
Reimplemented from scg::Camera.
|
virtual |
Get view transformation matrix according to camera position and orientation.
Reimplemented from scg::Camera.
| void scg::StereoCamera::init | ( | GLfloat | near, |
| GLfloat | far, | ||
| GLfloat | screenDist, | ||
| GLfloat | screenHeight, | ||
| GLfloat | interOcularDist | ||
| ) |
Initialize perspective stereo projection from screen dimensions. Aspect ratio is determined in updateProjection() from current viewport dimensions.
| near | near distance |
| far | far distance |
| screenDist | screen distance (zero parallax plane) |
| screenHeight | screen height |
| interOcularDist | interocular distance |
| void scg::StereoCamera::initBourke | ( | GLfloat | fovyDeg, |
| GLfloat | near, | ||
| GLfloat | far, | ||
| GLfloat | screenDist, | ||
| GLfloat | interOcularFactor | ||
| ) |
Initialize perspective stereo projection according to Bourke method. Aspect ratio is determined in updateProjection() from current viewport dimensions.
Source (modified):
http://paulbourke.net/miscellaneous/stereographics/stereorender/
| fovyDeg | vertical field of view angle (degrees) |
| near | near distance |
| far | far distance |
| screenDist | screen distance (zero parallax plane) |
| interOcularFactor | ratio interocular distance / screen distance |
|
virtual |
Render node, i.e., switch between left and right eye. Calls Camera::render().
Reimplemented from scg::Camera.
|
virtual |
Update projection matrix from current viewport dimensions, called by Renderer::render() (or derived class) if window has been resized.
Implements scg::Camera.
|
protected |
Definition at line 122 of file StereoCamera.h.
|
protected |
Definition at line 124 of file StereoCamera.h.
|
protected |
Definition at line 128 of file StereoCamera.h.
|
protected |
Definition at line 123 of file StereoCamera.h.
|
protected |
Definition at line 125 of file StereoCamera.h.
|
protected |
Definition at line 127 of file StereoCamera.h.
|
protected |
Definition at line 126 of file StereoCamera.h.