summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordon bright <hugh.m.bright@gmail.com>2013-02-21 12:31:18 (GMT)
committerdon bright <hugh.m.bright@gmail.com>2013-02-21 12:31:18 (GMT)
commitc724a393a9e617f5216fb97bf05a57bb6fd4df8e (patch)
treefb72603ca2af16aa6614ce48e80cb56baf74cf38 /src
parent88c071c5ed526be1e19fe8bdda79605ef642844d (diff)
distinguish between gimbal-camera and eye-center-camera
Diffstat (limited to 'src')
-rw-r--r--src/OffscreenView.cc10
-rw-r--r--src/OffscreenView.h7
-rw-r--r--src/QGLView.h7
-rw-r--r--src/qglview.cc22
4 files changed, 38 insertions, 8 deletions
diff --git a/src/OffscreenView.cc b/src/OffscreenView.cc
index bc1b97c..5c65bc4 100644
--- a/src/OffscreenView.cc
+++ b/src/OffscreenView.cc
@@ -67,6 +67,16 @@ void OffscreenView::resizeGL(int w, int h)
w_h_ratio = sqrt((double)w / (double)h);
}
+void OffscreenView::setupGimbalPerspective()
+{
+ fprintf(stderr, "gimbal camera not implemented in Offscreen View\n");
+}
+
+void OffscreenView::setupGimbalOrtho(double distance, bool offset)
+{
+ fprintf(stderr, "gimbal camera not implemented in Offscreen View\n");
+}
+
void OffscreenView::setupPerspective()
{
glMatrixMode(GL_PROJECTION);
diff --git a/src/OffscreenView.h b/src/OffscreenView.h
index 97d8198..2f19a0c 100644
--- a/src/OffscreenView.h
+++ b/src/OffscreenView.h
@@ -21,9 +21,14 @@ public:
void setCamera(const Eigen::Vector3d &pos, const Eigen::Vector3d &center);
void initializeGL();
void resizeGL(int w, int h);
+
+ void setupGimbalPerspective();
+ void setupGimbalOrtho(double distance, bool offset=false);
+
void setupPerspective();
void setupOrtho(bool offset=false);
- void paintGL();
+
+ void paintGL(); //
bool save(const char *filename); //
bool save(std::ostream &output); // not implemented in qgl?
std::string getRendererInfo(); //
diff --git a/src/QGLView.h b/src/QGLView.h
index 57e5faf..48a46df 100644
--- a/src/QGLView.h
+++ b/src/QGLView.h
@@ -80,8 +80,13 @@ private:
void initializeGL();
void resizeGL(int w, int h);
+
+ void setupGimbalPerspective();
+ void setupGimbalOrtho(double distance,bool offset=false);
+
void setupPerspective();
- void setupOrtho(double distance,bool offset=false);
+ void setupOrtho(bool offset=false);
+
void paintGL();
void normalizeAngle(GLdouble& angle);
diff --git a/src/qglview.cc b/src/qglview.cc
index c80d155..0afaa4b 100644
--- a/src/qglview.cc
+++ b/src/qglview.cc
@@ -340,18 +340,28 @@ void QGLView::resizeGL(int w, int h)
glViewport(0, 0, w, h);
w_h_ratio = sqrt((double)w / (double)h);
- setupPerspective();
+ setupGimbalPerspective();
}
void QGLView::setupPerspective()
{
+ fprintf(stderr,"non-gimbal camera not implemented for qglview\n");
+}
+
+void QGLView::setupOrtho(bool offset)
+{
+ fprintf(stderr,"non-gimbal camera not implemented for qglview\n");
+}
+
+void QGLView::setupGimbalPerspective()
+{
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-w_h_ratio, +w_h_ratio, -(1/w_h_ratio), +(1/w_h_ratio), +10.0, +FAR_FAR_AWAY);
gluLookAt(0.0, -viewer_distance, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0);
}
-void QGLView::setupOrtho(double distance, bool offset)
+void QGLView::setupGimbalOrtho(double distance, bool offset)
{
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
@@ -368,8 +378,8 @@ void QGLView::paintGL()
{
glEnable(GL_LIGHTING);
- if (orthomode) setupOrtho(viewer_distance);
- else setupPerspective();
+ if (orthomode) setupGimbalOrtho(viewer_distance);
+ else setupGimbalPerspective();
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
@@ -439,7 +449,7 @@ void QGLView::paintGL()
{
glDepthFunc(GL_ALWAYS);
- setupOrtho(1000,true);
+ setupGimbalOrtho(1000,true);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
@@ -508,7 +518,7 @@ void QGLView::paintGL()
//Restore perspective for next paint
if(!orthomode)
- setupPerspective();
+ setupGimbalPerspective();
}
if (statusLabel) {
contact: Jan Huwald // Impressum