diff --git a/Fltk/graphicWindow.cpp b/Fltk/graphicWindow.cpp index 70d674588f2b8a55dfbe1a244c61d83844b4a712..ea1676199e54e53e81bef9ce8db1a38d271fda66 100644 --- a/Fltk/graphicWindow.cpp +++ b/Fltk/graphicWindow.cpp @@ -584,6 +584,10 @@ graphicWindow::graphicWindow(bool main, int numTiles) int mode = FL_RGB | FL_DEPTH | (CTX::instance()->db ? FL_DOUBLE : FL_SINGLE); if(CTX::instance()->antialiasing) mode |= FL_MULTISAMPLE; //mode |= FL_STEREO; + if(CTX::instance()->stereo) { + mode |= FL_DOUBLE; + mode |= FL_STEREO; + } for(unsigned int i = 0; i < gl.size(); i++) gl[i]->mode(mode); tile->end(); diff --git a/Fltk/openglWindow.cpp b/Fltk/openglWindow.cpp index 82a734a0dbd0555e94ae812e56dfd6184d5be1e4..9e020b0fc82299c7bf39adee90de8e295e5235e5 100644 --- a/Fltk/openglWindow.cpp +++ b/Fltk/openglWindow.cpp @@ -271,8 +271,7 @@ void openglWindow::draw() glAccum(GL_RETURN,1.0); */ - glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT); - + //right eye XYZ eye =cam->eyesep / 2.0* cam->right; glMatrixMode(GL_PROJECTION); @@ -291,6 +290,8 @@ void openglWindow::draw() cam->up.x, cam->up.y, cam->up.z); _ctx->draw3d(); _ctx->draw2d(); + _drawScreenMessage(); + _drawBorder(); //left eye glMatrixMode(GL_PROJECTION); @@ -310,12 +311,12 @@ void openglWindow::draw() cam->up.x, cam->up.y, cam->up.z); _ctx->draw3d(); _ctx->draw2d(); - - glPushMatrix(); - + _drawScreenMessage(); + _drawBorder(); + } else{ - _ctx->draw3d(); + _ctx->draw3d(); _ctx->draw2d(); _drawScreenMessage(); _drawBorder(); diff --git a/Graphics/Camera.cpp b/Graphics/Camera.cpp index 82504520bf427fe0e71dc4d638ce36becfc259e0..38463dce72fc5deb65121b4b75f45c1abb0e9e9d 100644 --- a/Graphics/Camera.cpp +++ b/Graphics/Camera.cpp @@ -25,7 +25,8 @@ void Camera::init(){ on=true; glFnear=0.1 ; glFfar=10000; - eye_sep_ratio=.015; + // eye_sep_ratio=.015; + eye_sep_ratio=.05; // apparent angle of the screen height aperture = 25; focallength = 100.; diff --git a/Graphics/drawContext.cpp b/Graphics/drawContext.cpp index 1fb7d4b363bd5ecb416a65721fd6826f53c21bda..19e5902ba028438e6a9a6a7ebbc4314900d43715 100644 --- a/Graphics/drawContext.cpp +++ b/Graphics/drawContext.cpp @@ -455,7 +455,7 @@ void drawContext::initProjection(int xpick, int ypick, int wpick, int hpick) fabs(CTX::instance()->max[2])); if(zmax < CTX::instance()->lc) zmax = CTX::instance()->lc; - if (CTX::instance()->camera ) { // if we use the new camera mode + if ( (CTX::instance()->camera) && (!CTX::instance()->stereo) ) { // if we use the new camera mode double clip_near, clip_far; clip_near = 0.75 * CTX::instance()->clipFactor * zmax; @@ -472,12 +472,12 @@ void drawContext::initProjection(int xpick, int ypick, int wpick, int hpick) glBegin(GL_QUADS); //glColor4ubv((GLubyte *) & CTX::instance()->color.bg); glColor3d(.8,.8,.95); - glVertex3i(-dx,-dy,dz); - glVertex3i( dx,-dy,dz); + glVertex3i((int)-dx,(int)-dy,(int)dz); + glVertex3i((int) dx,(int)-dy,(int)dz); // glColor4ubv((GLubyte *) & CTX::instance()->color.bgGrad); glColor3d(.1,.1,.3); - glVertex3i( dx, dy,dz); - glVertex3i(-dx, dy,dz); + glVertex3i((int) dx,(int) dy,(int)dz); + glVertex3i((int)-dx,(int) dy,(int)dz); glEnd(); glPopMatrix(); glEnable(GL_DEPTH_TEST);